This documentation is archived and is not being maintained.

IPermission.Union Method

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

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)

'Declaration
Function Union ( _
	target As IPermission _
) As IPermission
'Usage
Dim instance As IPermission
Dim target As IPermission
Dim returnValue As IPermission

returnValue = instance.Union(target)
IPermission Union (
	IPermission target
)
function Union (
	target : IPermission
) : IPermission

Parameters

target

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

Return Value

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

Exception typeCondition

ArgumentException

The target parameter is not a null reference (Nothing in Visual Basic) and is not of the same type as the current permission.

The result of a call to Union is a permission that represents all the operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.

The following statements are required to be true for all implementations of the Union method. X and Y represent IPermission objects that are not a null reference (Nothing in Visual Basic).

  • X.Union(X) returns an object that has the same value as X.

  • X.Union(Y) returns an object that has the same value as the object returned by Y.Union(X).

  • X.Union(a null reference (Nothing in Visual Basic)) returns an object that has the same value as X.

The following code example demonstrates implementing the Union method. This code example is part of a larger example provided for the IPermission class.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Show: