ReflectionPermission.Flags Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
The set flags for the current permission.
Exceptions
An attempt is made to set this property to an invalid value. See ReflectionPermissionFlag for the valid values.
Examples
The following code example shows the use of the Flags property. 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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET