PermissionSet PermissionSet PermissionSet PermissionSet Constructors

定義

オーバーロード

PermissionSet(PermissionState) PermissionSet(PermissionState) PermissionSet(PermissionState) PermissionSet(PermissionState)

PermissionSet を指定して、PermissionState クラスの新しいインスタンスを初期化します。Initializes a new instance of the PermissionSet class with the specified PermissionState.

PermissionSet(PermissionSet) PermissionSet(PermissionSet) PermissionSet(PermissionSet) PermissionSet(PermissionSet)

PermissionSet パラメーターから取得した初期値を使用して、permSet クラスの新しいインスタンスを初期化します。Initializes a new instance of the PermissionSet class with initial values taken from the permSet parameter.

PermissionSet(PermissionState) PermissionSet(PermissionState) PermissionSet(PermissionState) PermissionSet(PermissionState)

PermissionSet を指定して、PermissionState クラスの新しいインスタンスを初期化します。Initializes a new instance of the PermissionSet class with the specified PermissionState.

public:
 PermissionSet(System::Security::Permissions::PermissionState state);
public PermissionSet (System.Security.Permissions.PermissionState state);
new System.Security.PermissionSet : System.Security.Permissions.PermissionState -> System.Security.PermissionSet
Public Sub New (state As PermissionState)

パラメーター

state
PermissionState PermissionState PermissionState PermissionState

アクセス許可セットのリソースへのアクセスを指定する列挙値の 1 つ。One of the enumeration values that specifies the permission set's access to resources.

例外

state パラメーターが正しい PermissionState ではありません。The state parameter is not a valid PermissionState.

次のコード例の使用を示しています、PermissionSetのアクセス許可の状態でアクセス許可を作成するコンス トラクターが設定Noneします。The following code example shows the use of the PermissionSet constructor to create a permission set with a permission state of None. このコード例が示されている例の一部、PermissionSetクラス。This code example is part of a larger example provided for the PermissionSet class.

// Open a new PermissionSet.
PermissionSet^ ps1 = gcnew PermissionSet( PermissionState::None );

Console::WriteLine( "Adding permission to open a file from a file dialog box." );

// Add a permission to the permission set.
ps1->AddPermission( gcnew FileDialogPermission( FileDialogPermissionAccess::Open ) );

Console::WriteLine( "Demanding permission to open a file." );
ps1->Demand();
Console::WriteLine( "Demand succeeded." );
// Open a new PermissionSet.
PermissionSet ps1 = new PermissionSet(PermissionState.None);
Console.WriteLine("Adding permission to open a file from a file dialog box.");
// Add a permission to the permission set.
ps1.AddPermission(
    new FileDialogPermission(FileDialogPermissionAccess.Open));
Console.WriteLine("Demanding permission to open a file.");
ps1.Demand();
Console.WriteLine("Demand succeeded.");
' Open a new PermissionSet.
Dim ps1 As New PermissionSet(PermissionState.None)
Console.WriteLine("Adding permission to open a file from a file dialog box.")
' Add a permission to the permission set.
ps1.AddPermission(New FileDialogPermission(FileDialogPermissionAccess.Open))
Console.WriteLine("Demanding permission to open a file.")
ps1.Demand()
Console.WriteLine("Demand succeeded.")

注釈

Unrestricted状態により、実装するすべてのアクセス許可、IUnrestrictedPermissionインターフェイス中Noneアクセス許可は許可されません。The Unrestricted state allows all permissions that implement the IUnrestrictedPermission interface, while None allows no permissions.

使用AddPermission、空でPermissionSetセットを定義する、さらに詳しく説明します。Use AddPermission on an empty PermissionSet to define the set in greater detail.

PermissionSet(PermissionSet) PermissionSet(PermissionSet) PermissionSet(PermissionSet) PermissionSet(PermissionSet)

PermissionSet パラメーターから取得した初期値を使用して、permSet クラスの新しいインスタンスを初期化します。Initializes a new instance of the PermissionSet class with initial values taken from the permSet parameter.

public:
 PermissionSet(System::Security::PermissionSet ^ permSet);
public PermissionSet (System.Security.PermissionSet permSet);
new System.Security.PermissionSet : System.Security.PermissionSet -> System.Security.PermissionSet
Public Sub New (permSet As PermissionSet)

パラメーター

permSet
PermissionSet PermissionSet PermissionSet PermissionSet

新しい PermissionSet の値の取得元となるセット。または、空の PermissionSet を作成する場合は nullThe set from which to take the value of the new PermissionSet, or null to create an empty PermissionSet.

注釈

新しいPermissionSet内、指定したアクセス許可のコピーを格納PermissionSetします。The new PermissionSet contains copies of the permissions contained in the specified PermissionSet.

注意

これに相当Copyときに、permSetパラメーターでないnullします。This is equivalent to Copy when the permSet parameter is not null.

適用対象