13 private string m_name;
15 private string m_description;
17 [OptionalField(VersionAdded = 2)]
18 internal string m_descrResource;
20 private static object s_InternalSyncObject;
44 if (m_descrResource !=
null)
46 m_description =
Environment.GetResourceString(m_descrResource);
47 m_descrResource =
null;
53 m_description = value;
54 m_descrResource =
null;
58 private static object InternalSyncObject
62 if (s_InternalSyncObject ==
null)
64 object value =
new object();
67 return s_InternalSyncObject;
71 internal NamedPermissionSet()
111 m_name = permSet.m_name;
121 private static void CheckName(
string name)
123 if (name ==
null || name.Equals(
""))
143 namedPermissionSet.
Name = name;
144 return namedPermissionSet;
152 if (m_name !=
null && !m_name.Equals(
""))
160 return securityElement;
169 FromXml(et, allowInternalOnly:
false, ignoreTypeLoadFailures:
false);
178 string text = et.Attribute(
"Name");
179 m_name = ((text ==
null) ?
null : text);
180 text = et.Attribute(
"Description");
181 m_description = ((text ==
null) ?
"" : text);
182 m_descrResource =
null;
183 base.FromXml(et, allowInternalOnly, ignoreTypeLoadFailures);
186 internal void FromXmlNameOnly(SecurityElement et)
188 string text = et.Attribute(
"Name");
189 m_name = ((text ==
null) ?
null : text);
199 return base.Equals(obj);
207 return base.GetHashCode();
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
NamedPermissionSet(string name, PermissionSet permSet)
Initializes a new instance of the T:System.Security.NamedPermissionSet class with the specified name ...
string Name
Gets or sets the name of the current named permission set.
override void FromXml(SecurityElement et)
Reconstructs a named permission set with a specified state from an XML encoding.
Use none of the security policy components.
NamedPermissionSet(string name, PermissionState state)
Initializes a new instance of the T:System.Security.NamedPermissionSet class with the specified name ...
static string Escape(string str)
Replaces invalid XML characters in a string with their valid XML equivalent.
Defines a permission set that has a name and description associated with it. This class cannot be inh...
NamedPermissionSet(string name)
Initializes a new, empty instance of the T:System.Security.NamedPermissionSet class with the specifie...
Provides information about, and means to manipulate, the current environment and platform....
Represents a collection that can contain many different types of permissions.
Represents the XML object model for encoding security objects. This class cannot be inherited.
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
override int GetHashCode()
Gets a hash code for the T:System.Security.NamedPermissionSet object that is suitable for use in hash...
override PermissionSet Copy()
Creates a permission set copy from a named permission set.
NamedPermissionSet(NamedPermissionSet permSet)
Initializes a new instance of the T:System.Security.NamedPermissionSet class from another named permi...
The exception that is thrown when one of the arguments provided to a method is not valid.
override bool Equals(object obj)
Determines whether the specified T:System.Security.NamedPermissionSet object is equal to the current ...
override SecurityElement ToXml()
Creates an XML element description of the named permission set.
NamedPermissionSet Copy(string name)
Creates a copy of the named permission set with a different name but the same permissions.
PermissionState
Specifies whether a permission should have all or no access to resources at creation.
string Description
Gets or sets the text description of the current named permission set.
void AddAttribute(string name, string value)
Adds a name/value attribute to an XML element.
Specifies that the class can be serialized.
Provides atomic operations for variables that are shared by multiple threads.