12 private const uint AllZones = 31u;
14 [OptionalField(VersionAdded = 2)]
17 [OptionalField(VersionAdded = 2)]
18 private string m_serializedPermission;
31 for (uint num2 = 1u; num2 < 31; num2 <<= 1)
33 if ((m_zones & num2) != 0)
54 m_zones = (uint)(1 << (
int)value);
64 if (m_serializedPermission !=
null)
67 m_serializedPermission =
null;
92 m_serializedPermission =
null;
124 m_zones = (zones & 0x1F);
127 internal void AppendZones(
ArrayList zoneList)
130 for (uint num2 = 1u; num2 < 31; num2 <<= 1)
132 if ((m_zones & num2) != 0)
142 if (zone < SecurityZone.NoZone || zone >
SecurityZone.Untrusted)
144 throw new ArgumentException(Environment.GetResourceString(
"Argument_IllegalZone"));
167 if (zoneIdentityPermission ==
null)
171 return (m_zones & zoneIdentityPermission.m_zones) == m_zones;
185 if (zoneIdentityPermission ==
null)
189 uint num = m_zones & zoneIdentityPermission.m_zones;
212 if (zoneIdentityPermission ==
null)
231 for (uint num2 = 1u; num2 < 31; num2 <<= 1)
233 if ((m_zones & num2) != 0)
237 securityElement.
AddChild(securityElement2);
242 return securityElement;
253 string text = esd.Attribute(
"Zone");
262 text = child.Attribute(
"Zone");
266 m_zones |= (uint)(1 << num);
272 int IBuiltInPermission.GetTokenIndex()
274 return GetTokenIndex();
277 internal static int GetTokenIndex()
override bool IsSubsetOf(IPermission target)
Determines whether the current permission is a subset of the specified permission.
static string GetName(Type enumType, object value)
Retrieves the name of the constant in the specified enumeration that has the specified value.
override void FromXml(SecurityElement esd)
Reconstructs a permission with a specified state from an XML encoding.
StreamingContextStates State
Gets the source or destination of the transmitted data.
SecurityZone
Defines the integer values corresponding to security zones used by security policy.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
override IPermission Copy()
Creates and returns an identical copy of the current 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...
override IPermission Intersect(IPermission target)
Creates and returns a permission that is the intersection of the current permission and the specified...
void AddChild(SecurityElement child)
Adds a child element to the XML element.
Provides information about, and means to manipulate, the current environment and platform....
override IPermission Union(IPermission target)
Creates a permission that is the union of the current permission and the specified permission.
Provides the base class for enumerations.
Represents the XML object model for encoding security objects. This class cannot be inherited.
Defines the underlying structure of all code access permissions.
SecurityZone SecurityZone
Gets or sets the zone represented by the current T:System.Security.Permissions.ZoneIdentityPermission...
Defines methods implemented by permission types.
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
ZoneIdentityPermission(SecurityZone zone)
Initializes a new instance of the T:System.Security.Permissions.ZoneIdentityPermission class to repre...
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.
static SecurityElement FromString(string xml)
Creates a security element from an XML-encoded string.
Defines the identity permission for the zone from which the code originates. This class cannot be inh...
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.
ArrayList Children
Gets or sets the array of child elements of the XML element.
StreamingContextStates
Defines a set of flags that specifies the source or destination context for the stream during seriali...
ZoneIdentityPermission(PermissionState state)
Initializes a new instance of the T:System.Security.Permissions.ZoneIdentityPermission class with the...
override string ToString()
Produces a string representation of an XML element and its constituent attributes,...
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...