Determines whether the current instance is a subset of the specified object.
- A System.Security.Permissions.EnvironmentPermission instance that is to be tested for the subset relationship.
true if the current instance is a subset of target ; otherwise, false. If the current instance is unrestricted, and target is not, returns false. If target is unrestricted, returns true. If target is null and no environment variables are secured by the current instance, returns true. If target is null, and the current instance secures one or more environment variables, returns false.
Type Reason ArgumentException target is not null and is not of type System.Security.Permissions.EnvironmentPermission .
The current instance is a subset of target if the current instance specifies a set of accesses to resources that is wholly contained by target. For example, a permission that represents read access to a file is a subset of a permission that represents read and write access to the file.
If this method returns true , the current instance describes a level of access to a set of environment variables that is also described by target.
This method overrides System.Security.CodeAccessPermission.IsSubsetOf(System.Security.IPermission) and is implemented to support the System.Security.IPermission interface.