ReflectionPermission.Flags プロパティ

定義

現在のアクセス許可で使用できるリフレクションの型を取得または設定します。Gets or sets the type of reflection allowed for the current permission.

public:
 property System::Security::Permissions::ReflectionPermissionFlag Flags { System::Security::Permissions::ReflectionPermissionFlag get(); void set(System::Security::Permissions::ReflectionPermissionFlag value); };
public System.Security.Permissions.ReflectionPermissionFlag Flags { get; set; }
member this.Flags : System.Security.Permissions.ReflectionPermissionFlag with get, set
Public Property Flags As ReflectionPermissionFlag

プロパティ値

現在のアクセス許可に対する設定フラグ。The set flags for the current permission.

例外

このプロパティを無効な値に設定しようとしました。An attempt is made to set this property to an invalid value. 有効な値については、ReflectionPermissionFlag のトピックを参照してください。See ReflectionPermissionFlag for the valid values.

次のコード例は、 Flagsプロパティの使用方法を示しています。The following code example shows the use of the Flags property. この例は、 ReflectionPermissionクラスに対して提供される大規模な例の一部です。This example is part of a larger example provided for the ReflectionPermission class.

private static void IsSubsetOfDemo()
{
    ReflectionPermission memberAccessPerm = new ReflectionPermission(ReflectionPermissionFlag.MemberAccess);
    ReflectionPermission restrictedMemberAccessPerm = new ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess);

    if (restrictedMemberAccessPerm.IsSubsetOf(memberAccessPerm))
    {
        Console.WriteLine(restrictedMemberAccessPerm.Flags + " is a subset of " +
            memberAccessPerm.Flags);
    }
    else
    {
        Console.WriteLine(restrictedMemberAccessPerm.Flags + " is not a subset of " +
            memberAccessPerm.Flags);
    }
}
Private Shared Sub IsSubsetOfDemo()

    Dim memberAccessPerm As New ReflectionPermission(ReflectionPermissionFlag.MemberAccess)
    Dim restrictedMemberAccessPerm As New ReflectionPermission(ReflectionPermissionFlag.RestrictedMemberAccess)
    If restrictedMemberAccessPerm.IsSubsetOf(memberAccessPerm) Then
        Console.WriteLine(restrictedMemberAccessPerm.Flags + " is a subset of " + memberAccessPerm.Flags)
    Else
        Console.WriteLine(restrictedMemberAccessPerm.Flags.ToString() + _
        " is not a subset of " + memberAccessPerm.Flags.ToString())
    End If

End Sub

適用対象