ZoneIdentityPermission.Union(IPermission) Method

Definition

Creates a permission that is the union of the current permission and the specified permission.

public:
 override System::Security::IPermission ^ Union(System::Security::IPermission ^ target);
public override System.Security.IPermission Union (System.Security.IPermission target);
override this.Union : System.Security.IPermission -> System.Security.IPermission
Public Overrides Function Union (target As IPermission) As IPermission

Parameters

target
IPermission

A permission to combine with the current permission. It must be of the same type as the current permission.

Returns

A new permission that represents the union of the current permission and the specified permission.

Exceptions

The target parameter is not null and is not of the same type as the current permission.

-or-

The two permissions are not equal and the current permission does not represent the NoZone security zone.

Remarks

The result of a call to Union is a permission that represents the security zone represented by both the current permission and the specified permission. Any demand that passes either permission passes their union. The union of two identical ZoneIdentityPermission objects is the same permission. The union of a null permission and a ZoneIdentityPermission permission is the permission that is not null.

Note that a ZoneIdentityPermission object representing a NoZone security zone is treated as a null permission and handled as a special case. The union of a ZoneIdentityPermission object representing the NoZone security zone and a null permission is null. The union of two different zone identity permissions results in an ArgumentException exception being thrown when neither of the two permissions represents the NoZone security zone.

Applies to