Mono Class Library: System.Security.CodeAccessPermission Overview | Members

System.Security.CodeAccessPermission.Union Method

Returns a System.Security.CodeAccessPermission object that is the union of the current instance and the specified object.

public virtual IPermission Union (IPermission other)

Parameters

other
A System.Security.IPermission object of the same type as the current instance to be combined with the current instance.

Returns

If other is null, returns a copy of the current instance using the IPermission.Copy method.

Exceptions

TypeReason
ArgumentExceptionother is not of type System.Security.CodeAccessPermission .
NotSupportedExceptionother is not null.

Remarks

Note: This method is implemented to support the System.Security.IPermission interface.

Operation
This method returns a new System.Security.CodeAccessPermission instance that represents the union of the current instance and other. If the current instance or other is unrestricted, returns a System.Security.CodeAccessPermission instance that is unrestricted. If other is null, returns a copy of the current instance using the IPermission.Copy method.

If other is not null, this method throws a NotSupportedException exception; otherwise, returns a copy of the current instance.

Note to Inheritors
Override this method to provide a mechanism for creating the union of two System.Security.IPermission objects that are of the same type and are derived from System.Security.CodeAccessPermission .

Usage
The result of a call to CodeAccessPermission.Union(IPermission) is a permission that represents all of the access to resources represented by both the current instance and other . Any demand that passes either permission passes their union.

Requirements

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