mscorlib(4.0.0.0) API with additions
AllMembershipCondition.cs
2 using System.Security.Util;
3 
5 {
7  [Serializable]
8  [ComVisible(true)]
9  public sealed class AllMembershipCondition : IMembershipCondition, ISecurityEncodable, ISecurityPolicyEncodable, IConstantMembershipCondition, IReportMatchMembershipCondition
10  {
14  public bool Check(Evidence evidence)
15  {
16  object usedEvidence = null;
17  return ((IReportMatchMembershipCondition)this).Check(evidence, out usedEvidence);
18  }
19 
20  bool IReportMatchMembershipCondition.Check(Evidence evidence, out object usedEvidence)
21  {
22  usedEvidence = null;
23  return true;
24  }
25 
29  {
30  return new AllMembershipCondition();
31  }
32 
35  public override string ToString()
36  {
37  return Environment.GetResourceString("All_ToString");
38  }
39 
43  {
44  return ToXml(null);
45  }
46 
49  public void FromXml(SecurityElement e)
50  {
51  FromXml(e, null);
52  }
53 
58  {
59  SecurityElement securityElement = new SecurityElement("IMembershipCondition");
60  XMLUtil.AddClassAttribute(securityElement, GetType(), "System.Security.Policy.AllMembershipCondition");
61  securityElement.AddAttribute("version", "1");
62  return securityElement;
63  }
64 
70  public void FromXml(SecurityElement e, PolicyLevel level)
71  {
72  if (e == null)
73  {
74  throw new ArgumentNullException("e");
75  }
76  if (!e.Tag.Equals("IMembershipCondition"))
77  {
78  throw new ArgumentException(Environment.GetResourceString("Argument_MembershipConditionElement"));
79  }
80  }
81 
86  public override bool Equals(object o)
87  {
88  return o is AllMembershipCondition;
89  }
90 
93  public override int GetHashCode()
94  {
95  return typeof(AllMembershipCondition).GetHashCode();
96  }
97  }
98 }
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
override int GetHashCode()
Gets the hash code for the current membership condition.
Represents the security policy levels for the common language runtime. This class cannot be inherited...
Definition: PolicyLevel.cs:15
Definition: __Canon.cs:3
void FromXml(SecurityElement e)
Reconstructs a security object with a specified state from an XML encoding.
string Tag
Gets or sets the tag name of an XML element.
void FromXml(SecurityElement e, PolicyLevel level)
Reconstructs a security object with a specified state from an XML encoding.
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
SecurityElement ToXml(PolicyLevel level)
Creates an XML encoding of the security object and its current state with the specified T:System....
Defines the test to determine whether a code assembly is a member of a code group.
Represents the XML object model for encoding security objects. This class cannot be inherited.
IMembershipCondition Copy()
Creates an equivalent copy of the membership condition.
Defines the methods that convert permission object state to and from XML element representation.
override bool Equals(object o)
Determines whether the specified membership condition is an T:System.Security.Policy....
Represents a membership condition that matches all code. This class cannot be inherited.
The exception that is thrown when one of the arguments provided to a method is not valid.
Supports the methods that convert permission object state to and from an XML element representation.
override string ToString()
Creates and returns a string representation of the membership condition.
Defines the set of information that constitutes input to security policy decisions....
Definition: Evidence.cs:17
void AddAttribute(string name, string value)
Adds a name/value attribute to an XML element.
bool Check(Evidence evidence)
Determines whether the specified evidence satisfies the membership condition.
SecurityElement ToXml()
Creates an XML encoding of the security object and its current state.