Export (0) Print
Expand All

PublisherIdentityPermission.IsSubsetOf Method

Determines whether the current permission is a subset of the specified permission.

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

public override bool IsSubsetOf(
	IPermission target
)

Parameters

target
Type: System.Security.IPermission

A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.

Return Value

Type: System.Boolean
true if the current permission is a subset of the specified permission; otherwise, false.

Implements

IPermission.IsSubsetOf(IPermission)

ExceptionCondition
ArgumentException

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

The current permission is a subset of the specified permission if the two permissions are equal. If this method returns true, the current permission represents the same access to the protected resource as the specified permission.

PublisherIdentityPermission supports set operations (IsSubsetOf, Intersect, and Union) only when the current permission is equal to the specified permission.

The following code example shows the behavior of the IsSubsetOf method. This example is part of a larger example that is provided for the PublisherIdentityPermission class.

NoteNote:

The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.

private static void IsSubsetOfDemo()
{

    if (publisherPerm2.IsSubsetOf(publisherPerm1))
    {
        Console.WriteLine(publisherPerm2.Certificate.Subject + " is a subset of " +
            publisherPerm1.Certificate.Subject);
    }
    else
    {
        Console.WriteLine(publisherPerm2.Certificate.Subject + " is not a subset of " +
            publisherPerm1.Certificate.Subject);
    }
}

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

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft