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
ניתן למצוא את המקור לתוכן זה ב- GitHub, שם ניתן גם ליצור ולסקור בעיות ולמשוך בקשות. לקבלת מידע נוסף, עיין במדריך התורמים שלנו.