25 VerifyWindowFlag(value);
36 return m_clipboardFlag;
40 VerifyClipboardFlag(value);
41 m_clipboardFlag = value;
53 SetUnrestricted(unrestricted:
true);
56 SetUnrestricted(unrestricted:
false);
70 VerifyWindowFlag(windowFlag);
71 VerifyClipboardFlag(clipboardFlag);
72 m_windowFlag = windowFlag;
73 m_clipboardFlag = clipboardFlag;
81 VerifyWindowFlag(windowFlag);
82 m_windowFlag = windowFlag;
90 VerifyClipboardFlag(clipboardFlag);
91 m_clipboardFlag = clipboardFlag;
116 private void SetUnrestricted(
bool unrestricted)
163 return m_windowFlag <= uIPermission.m_windowFlag && m_clipboardFlag <= uIPermission.m_clipboardFlag;
181 if (!VerifyType(target))
186 UIPermissionWindow uIPermissionWindow = (m_windowFlag < uIPermission.m_windowFlag) ? m_windowFlag : uIPermission.m_windowFlag;
187 UIPermissionClipboard uIPermissionClipboard = (m_clipboardFlag < uIPermission.m_clipboardFlag) ? m_clipboardFlag : uIPermission.m_clipboardFlag;
192 return new UIPermission(uIPermissionWindow, uIPermissionClipboard);
205 if (!VerifyType(target))
210 UIPermissionWindow uIPermissionWindow = (m_windowFlag > uIPermission.m_windowFlag) ? m_windowFlag : uIPermission.m_windowFlag;
211 UIPermissionClipboard uIPermissionClipboard = (m_clipboardFlag > uIPermission.m_clipboardFlag) ? m_clipboardFlag : uIPermission.m_clipboardFlag;
216 return new UIPermission(uIPermissionWindow, uIPermissionClipboard);
233 if (m_windowFlag != 0)
237 if (m_clipboardFlag != 0)
246 return securityElement;
256 if (XMLUtil.IsUnrestricted(esd))
258 SetUnrestricted(unrestricted:
true);
263 string text = esd.Attribute(
"Window");
268 string text2 = esd.Attribute(
"Clipboard");
275 int IBuiltInPermission.GetTokenIndex()
277 return GetTokenIndex();
280 internal static int GetTokenIndex()
static string GetName(Type enumType, object value)
Retrieves the name of the constant in the specified enumeration that has the specified value.
Allows a permission to expose an unrestricted state.
UIPermission(UIPermissionWindow windowFlag, UIPermissionClipboard clipboardFlag)
Initializes a new instance of the T:System.Security.Permissions.UIPermission class with the specified...
override bool IsSubsetOf(IPermission target)
Determines whether the current permission is a subset of the specified permission.
The exception that is thrown for invalid casting or explicit conversion.
UIPermissionWindow
Specifies the type of windows that code is allowed to use.
override void FromXml(SecurityElement esd)
Reconstructs a permission with a specified state from an XML encoding.
override IPermission Copy()
Creates and returns an identical copy of the current permission.
UIPermissionWindow Window
Gets or sets the window access represented by the permission.
static object Parse(Type enumType, string value)
Converts the string representation of the name or numeric value of one or more enumerated constants t...
UIPermission(UIPermissionWindow windowFlag)
Initializes a new instance of the T:System.Security.Permissions.UIPermission class with the permissio...
Provides information about, and means to manipulate, the current environment and platform....
UIPermission(UIPermissionClipboard clipboardFlag)
Initializes a new instance of the T:System.Security.Permissions.UIPermission class with the permissio...
Provides the base class for enumerations.
Represents the XML object model for encoding security objects. This class cannot be inherited.
bool IsUnrestricted()
Returns a value indicating whether the current permission is unrestricted.
override IPermission Union(IPermission target)
Creates a permission that is the union of the permission and the specified permission.
Controls the permissions related to user interfaces and the Clipboard. This class cannot be inherited...
UIPermission(PermissionState state)
Initializes a new instance of the T:System.Security.Permissions.UIPermission class with either fully ...
Defines the underlying structure of all code access permissions.
override IPermission Intersect(IPermission target)
Creates and returns a permission that is the intersection of the current permission and the specified...
Defines methods implemented by permission types.
The exception that is thrown when one of the arguments provided to a method is not valid.
override SecurityElement ToXml()
Creates an XML encoding of the permission and its current state.
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
void AddAttribute(string name, string value)
Adds a name/value attribute to an XML element.
Specifies that the class can be serialized.
UIPermissionClipboard
Specifies the type of clipboard access that is allowed to the calling code.
UIPermissionClipboard Clipboard
Gets or sets the Clipboard access represented by the permission.