Mono Class Library: System.Security.Permissions.EnvironmentPermission Overview | Members

System.Security.Permissions.EnvironmentPermission.Union Method

Returns a new System.Security.Permissions.EnvironmentPermission that is the union of the current instance and the specified object.

public override System.Security.IPermission Union (System.Security.IPermission other)

Parameters

other
A System.Security.Permissions.EnvironmentPermission instance to combine with the current instance.

Returns

A new System.Security.Permissions.EnvironmentPermission instance that represents the union of the current instance and other . If the current instance or other is unrestricted, returns a System.Security.Permissions.EnvironmentPermission instance that is unrestricted. If other is null, returns a copy of the current instance via the System.Security.IPermission.Copy method. If the current instance and other do not specify any environment variables, returns null .

Exceptions

TypeReason
ArgumentExceptionother is not null and is not of type System.Security.Permissions.EnvironmentPermission .

Remarks

Note:

The result of a call to EnvironmentPermission.Union(System.Security.IPermission) is a permission that represents the access to environment variables represented by the current instance as well as the access to environment variables represented by other. Any demand that passes either the current instance or other passes their union.

This method overrides System.Security.CodeAccessPermission.Union(System.Security.IPermission) and is implemented to support the System.Security.IPermission interface.

Requirements

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0