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

System.Security.IPermission.Union Method

Returns an object that is the union of the current instance and the specified object.

public IPermission Union (IPermission target)

Parameters

target
A System.Security.IPermission object of the same type as the current instance to combine with the current instance.

Returns

A new System.Security.IPermission object of the same type as the current instance that represents the union of the current instance and target.

Exceptions

TypeReason
ArgumentExceptiontarget is not null and is not of the same type as the current instance.

Remarks

The object returned by IPermission.Union(IPermission) is a permission that represents the permissions described by the current instance and those described by target . Any demand that passes either the current instance or target is required to pass the union of the two.

Operation

If target is not null and is not of the same type as the current instance, a ArgumentException exception is required to be thrown.

The following statements are required to be true for all implementations of the IPermission.Union(IPermission) method. X and Y represent non-null System.Security.IPermission objects.

  • X.Union(X) returns an object that is value-equal to X.
  • X.Union(Y) returns an object that is value-equal to the object returned by Y.Union(X).
  • X.Union(null) returns an object that is value-equal to X .

Usage
Use this method to obtain a System.Security.IPermission object of the same type as the current instance and target that describes the permissions described by the current instance and those described by target.

Requirements

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