DnsPermission.Union Method (IPermission)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Net
Assembly:  System (in System.dll)

override Union : 
        target:IPermission -> IPermission

Parameters

target
Type: System.Security.IPermission

The DnsPermission instance to combine with the current instance.

Return Value

Type: System.Security.IPermission

A DnsPermission instance that represents the union of the current DnsPermission instance with the specified DnsPermission instance. If target is null, this method returns a copy of the current instance. If the current instance or target is unrestricted, this method returns a DnsPermission instance that is unrestricted; otherwise, it returns a DnsPermission instance that is restricted.

Exception Condition
ArgumentException

target is neither a DnsPermission nor null.

The Union method returns a DnsPermission instance that allows the access defined by either the current DnsPermission instance or the specified DnsPermission instance. Any demand that passes either permission passes their union.

The following example creates a permission instance that is the union of the current permission instance and the specified permission instance.

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

.NET Framework
Available since 1.1
Return to top
Show: