10 private bool m_noRestriction;
23 m_noRestriction = free;
31 return m_noRestriction;
53 if (dnsPermission ==
null)
57 return new DnsPermission(m_noRestriction || dnsPermission.m_noRestriction);
72 if (dnsPermission ==
null)
76 if (m_noRestriction && dnsPermission.m_noRestriction)
93 return !m_noRestriction;
96 if (dnsPermission ==
null)
102 return dnsPermission.m_noRestriction;
115 if (securityElement ==
null)
119 if (!securityElement.
Tag.Equals(
"IPermission"))
121 throw new ArgumentException(SR.GetString(
"net_no_classname"),
"securityElement");
123 string text = securityElement.Attribute(
"class");
126 throw new ArgumentException(SR.GetString(
"net_no_classname"),
"securityElement");
128 if (text.IndexOf(GetType().FullName) < 0)
132 string text2 = securityElement.Attribute(
"Unrestricted");
133 m_noRestriction = (text2 !=
null &&
string.Compare(text2,
"true",
StringComparison.OrdinalIgnoreCase) == 0);
141 securityElement.
AddAttribute(
"class", GetType().FullName +
", " + GetType().
Module.Assembly.FullName.Replace(
'"',
'\''));
147 return securityElement;
Allows a permission to expose an unrestricted state.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
StringComparison
Specifies the culture, case, and sort rules to be used by certain overloads of the M:System....
override void FromXml(SecurityElement securityElement)
Reconstructs a T:System.Net.DnsPermission instance from an XML encoding.
override IPermission Intersect(IPermission target)
Creates a permission instance that is the intersection of the current permission instance and the spe...
string Tag
Gets or sets the tag name of an XML element.
override IPermission Union(IPermission target)
Creates a permission instance that is the union of the current permission instance and the specified ...
Represents the XML object model for encoding security objects. This class cannot be inherited.
Defines the underlying structure of all code access permissions.
override SecurityElement ToXml()
Creates an XML encoding of a T:System.Net.DnsPermission instance and its current state.
Controls rights to access Domain Name System (DNS) servers on the network.
override bool IsSubsetOf(IPermission target)
Determines whether the current permission instance is a subset of the specified permission instance.
Defines methods implemented by permission types.
The exception that is thrown when one of the arguments provided to a method is not valid.
Attribute can be applied to a module.
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.
bool IsUnrestricted()
Checks the overall permission state of the object.
override IPermission Copy()
Creates an identical copy of the current permission instance.
DnsPermission(PermissionState state)
Creates a new instance of the T:System.Net.DnsPermission class that either allows unrestricted DNS ac...