mscorlib(4.0.0.0) API with additions
NetCodeGroup.cs
1 using System.Collections;
2 using System.Diagnostics;
6 using System.Text;
7 
9 {
11  [Serializable]
12  [ComVisible(true)]
13  public sealed class NetCodeGroup : CodeGroup, IUnionSemanticCodeGroup
14  {
15  [OptionalField(VersionAdded = 2)]
16  private ArrayList m_schemesList;
17 
18  [OptionalField(VersionAdded = 2)]
19  private ArrayList m_accessList;
20 
21  private const string c_IgnoreUserInfo = "";
22 
23  private const string c_AnyScheme = "([0-9a-z+\\-\\.]+)://";
24 
25  private static readonly char[] c_SomeRegexChars = new char[12]
26  {
27  '.',
28  '-',
29  '+',
30  '[',
31  ']',
32  '{',
33  '$',
34  '^',
35  '#',
36  ')',
37  '(',
38  ' '
39  };
40 
42  public static readonly string AnyOtherOriginScheme = CodeConnectAccess.AnyScheme;
43 
45  public static readonly string AbsentOriginScheme = string.Empty;
46 
49  public override string MergeLogic => Environment.GetResourceString("MergeLogic_Union");
50 
53  public override string PermissionSetName => Environment.GetResourceString("NetCodeGroup_PermissionSet");
54 
57  public override string AttributeString => null;
58 
59  [SecurityCritical]
60  [Conditional("_DEBUG")]
61  private static void DEBUG_OUT(string str)
62  {
63  }
64 
65  [OnDeserializing]
66  private void OnDeserializing(StreamingContext ctx)
67  {
68  m_schemesList = null;
69  m_accessList = null;
70  }
71 
72  internal NetCodeGroup()
73  {
74  SetDefaults();
75  }
76 
81  public NetCodeGroup(IMembershipCondition membershipCondition)
82  : base(membershipCondition, (PolicyStatement)null)
83  {
84  SetDefaults();
85  }
86 
88  public void ResetConnectAccess()
89  {
90  m_schemesList = null;
91  m_accessList = null;
92  }
93 
102  public void AddConnectAccess(string originScheme, CodeConnectAccess connectAccess)
103  {
104  if (originScheme == null)
105  {
106  throw new ArgumentNullException("originScheme");
107  }
108  if (originScheme != AbsentOriginScheme && originScheme != AnyOtherOriginScheme && !CodeConnectAccess.IsValidScheme(originScheme))
109  {
110  throw new ArgumentOutOfRangeException("originScheme");
111  }
112  if (originScheme == AbsentOriginScheme && connectAccess.IsOriginScheme)
113  {
114  throw new ArgumentOutOfRangeException("connectAccess");
115  }
116  if (m_schemesList == null)
117  {
118  m_schemesList = new ArrayList();
119  m_accessList = new ArrayList();
120  }
121  originScheme = originScheme.ToLower(CultureInfo.InvariantCulture);
122  for (int i = 0; i < m_schemesList.Count; i++)
123  {
124  if (!((string)m_schemesList[i] == originScheme))
125  {
126  continue;
127  }
128  if (connectAccess == null)
129  {
130  return;
131  }
132  ArrayList arrayList = (ArrayList)m_accessList[i];
133  for (i = 0; i < arrayList.Count; i++)
134  {
135  if (((CodeConnectAccess)arrayList[i]).Equals(connectAccess))
136  {
137  return;
138  }
139  }
140  arrayList.Add(connectAccess);
141  return;
142  }
143  m_schemesList.Add(originScheme);
144  ArrayList arrayList2 = new ArrayList();
145  m_accessList.Add(arrayList2);
146  if (connectAccess != null)
147  {
148  arrayList2.Add(connectAccess);
149  }
150  }
151 
155  {
156  if (m_schemesList == null)
157  {
158  return null;
159  }
160  DictionaryEntry[] array = new DictionaryEntry[m_schemesList.Count];
161  for (int i = 0; i < array.Length; i++)
162  {
163  array[i].Key = m_schemesList[i];
164  array[i].Value = ((ArrayList)m_accessList[i]).ToArray(typeof(CodeConnectAccess));
165  }
166  return array;
167  }
168 
174  [SecuritySafeCritical]
175  public override PolicyStatement Resolve(Evidence evidence)
176  {
177  if (evidence == null)
178  {
179  throw new ArgumentNullException("evidence");
180  }
181  object usedEvidence = null;
182  if (PolicyManager.CheckMembershipCondition(base.MembershipCondition, evidence, out usedEvidence))
183  {
184  PolicyStatement policyStatement = CalculateAssemblyPolicy(evidence);
185  IDelayEvaluatedEvidence delayEvaluatedEvidence = usedEvidence as IDelayEvaluatedEvidence;
186  if (delayEvaluatedEvidence != null && !delayEvaluatedEvidence.IsVerified)
187  {
188  policyStatement.AddDependentEvidence(delayEvaluatedEvidence);
189  }
190  bool flag = false;
191  IEnumerator enumerator = base.Children.GetEnumerator();
192  while (enumerator.MoveNext() && !flag)
193  {
194  PolicyStatement policyStatement2 = PolicyManager.ResolveCodeGroup(enumerator.Current as CodeGroup, evidence);
195  if (policyStatement2 != null)
196  {
197  policyStatement.InplaceUnion(policyStatement2);
198  if ((policyStatement2.Attributes & PolicyStatementAttribute.Exclusive) == PolicyStatementAttribute.Exclusive)
199  {
200  flag = true;
201  }
202  }
203  }
204  return policyStatement;
205  }
206  return null;
207  }
208 
209  PolicyStatement IUnionSemanticCodeGroup.InternalResolve(Evidence evidence)
210  {
211  if (evidence == null)
212  {
213  throw new ArgumentNullException("evidence");
214  }
215  if (base.MembershipCondition.Check(evidence))
216  {
217  return CalculateAssemblyPolicy(evidence);
218  }
219  return null;
220  }
221 
226  public override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
227  {
228  if (evidence == null)
229  {
230  throw new ArgumentNullException("evidence");
231  }
232  if (base.MembershipCondition.Check(evidence))
233  {
234  CodeGroup codeGroup = Copy();
235  codeGroup.Children = new ArrayList();
236  IEnumerator enumerator = base.Children.GetEnumerator();
237  while (enumerator.MoveNext())
238  {
239  CodeGroup codeGroup2 = ((CodeGroup)enumerator.Current).ResolveMatchingCodeGroups(evidence);
240  if (codeGroup2 != null)
241  {
242  codeGroup.AddChild(codeGroup2);
243  }
244  }
245  return codeGroup;
246  }
247  return null;
248  }
249 
250  private string EscapeStringForRegex(string str)
251  {
252  int num = 0;
253  StringBuilder stringBuilder = null;
254  int num2;
255  while (num < str.Length && (num2 = str.IndexOfAny(c_SomeRegexChars, num)) != -1)
256  {
257  if (stringBuilder == null)
258  {
259  stringBuilder = new StringBuilder(str.Length * 2);
260  }
261  stringBuilder.Append(str, num, num2 - num).Append('\\').Append(str[num2]);
262  num = num2 + 1;
263  }
264  if (stringBuilder == null)
265  {
266  return str;
267  }
268  if (num < str.Length)
269  {
270  stringBuilder.Append(str, num, str.Length - num);
271  }
272  return stringBuilder.ToString();
273  }
274 
275  internal SecurityElement CreateWebPermission(string host, string scheme, string port, string assemblyOverride)
276  {
277  if (scheme == null)
278  {
279  scheme = string.Empty;
280  }
281  if (host == null || host.Length == 0)
282  {
283  return null;
284  }
285  host = host.ToLower(CultureInfo.InvariantCulture);
286  scheme = scheme.ToLower(CultureInfo.InvariantCulture);
287  int intPort = -1;
288  if (port != null && port.Length != 0)
289  {
290  intPort = int.Parse(port, CultureInfo.InvariantCulture);
291  }
292  else
293  {
294  port = string.Empty;
295  }
296  CodeConnectAccess[] array = FindAccessRulesForScheme(scheme);
297  if (array == null || array.Length == 0)
298  {
299  return null;
300  }
301  SecurityElement securityElement = new SecurityElement("IPermission");
302  string str = (assemblyOverride == null) ? "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" : assemblyOverride;
303  securityElement.AddAttribute("class", "System.Net.WebPermission, " + str);
304  securityElement.AddAttribute("version", "1");
305  SecurityElement securityElement2 = new SecurityElement("ConnectAccess");
306  host = EscapeStringForRegex(host);
307  scheme = EscapeStringForRegex(scheme);
308  string text = TryPermissionAsOneString(array, scheme, host, intPort);
309  if (text != null)
310  {
311  SecurityElement securityElement3 = new SecurityElement("URI");
312  securityElement3.AddAttribute("uri", text);
313  securityElement2.AddChild(securityElement3);
314  }
315  else
316  {
317  if (port.Length != 0)
318  {
319  port = ":" + port;
320  }
321  for (int i = 0; i < array.Length; i++)
322  {
323  text = GetPermissionAccessElementString(array[i], scheme, host, port);
324  SecurityElement securityElement4 = new SecurityElement("URI");
325  securityElement4.AddAttribute("uri", text);
326  securityElement2.AddChild(securityElement4);
327  }
328  }
329  securityElement.AddChild(securityElement2);
330  return securityElement;
331  }
332 
333  private CodeConnectAccess[] FindAccessRulesForScheme(string lowerCaseScheme)
334  {
335  if (m_schemesList == null)
336  {
337  return null;
338  }
339  int num = m_schemesList.IndexOf(lowerCaseScheme);
340  if (num == -1 && (lowerCaseScheme == AbsentOriginScheme || (num = m_schemesList.IndexOf(AnyOtherOriginScheme)) == -1))
341  {
342  return null;
343  }
344  ArrayList arrayList = (ArrayList)m_accessList[num];
345  return (CodeConnectAccess[])arrayList.ToArray(typeof(CodeConnectAccess));
346  }
347 
348  private string TryPermissionAsOneString(CodeConnectAccess[] access, string escapedScheme, string escapedHost, int intPort)
349  {
350  bool flag = true;
351  bool flag2 = true;
352  bool flag3 = false;
353  int num = -2;
354  for (int i = 0; i < access.Length; i++)
355  {
356  flag &= (access[i].IsDefaultPort || (access[i].IsOriginPort && intPort == -1));
357  flag2 &= (access[i].IsOriginPort || access[i].Port == intPort);
358  if (access[i].Port >= 0)
359  {
360  if (num == -2)
361  {
362  num = access[i].Port;
363  }
364  else if (access[i].Port != num)
365  {
366  num = -1;
367  }
368  }
369  else
370  {
371  num = -1;
372  }
373  if (access[i].IsAnyScheme)
374  {
375  flag3 = true;
376  }
377  }
378  if (!flag && !flag2 && num == -1)
379  {
380  return null;
381  }
382  StringBuilder stringBuilder = new StringBuilder("([0-9a-z+\\-\\.]+)://".Length * access.Length + "".Length * 2 + escapedHost.Length);
383  if (flag3)
384  {
385  stringBuilder.Append("([0-9a-z+\\-\\.]+)://");
386  }
387  else
388  {
389  stringBuilder.Append('(');
390  for (int j = 0; j < access.Length; j++)
391  {
392  int k;
393  for (k = 0; k < j && !(access[j].Scheme == access[k].Scheme); k++)
394  {
395  }
396  if (k == j)
397  {
398  if (j != 0)
399  {
400  stringBuilder.Append('|');
401  }
402  stringBuilder.Append(access[j].IsOriginScheme ? escapedScheme : EscapeStringForRegex(access[j].Scheme));
403  }
404  }
405  stringBuilder.Append(")://");
406  }
407  stringBuilder.Append("").Append(escapedHost);
408  if (!flag)
409  {
410  if (flag2)
411  {
412  stringBuilder.Append(':').Append(intPort);
413  }
414  else
415  {
416  stringBuilder.Append(':').Append(num);
417  }
418  }
419  stringBuilder.Append("/.*");
420  return stringBuilder.ToString();
421  }
422 
423  private string GetPermissionAccessElementString(CodeConnectAccess access, string escapedScheme, string escapedHost, string strPort)
424  {
425  StringBuilder stringBuilder = new StringBuilder("([0-9a-z+\\-\\.]+)://".Length * 2 + "".Length + escapedHost.Length);
426  if (access.IsAnyScheme)
427  {
428  stringBuilder.Append("([0-9a-z+\\-\\.]+)://");
429  }
430  else if (access.IsOriginScheme)
431  {
432  stringBuilder.Append(escapedScheme).Append("://");
433  }
434  else
435  {
436  stringBuilder.Append(EscapeStringForRegex(access.Scheme)).Append("://");
437  }
438  stringBuilder.Append("").Append(escapedHost);
439  if (!access.IsDefaultPort)
440  {
441  if (access.IsOriginPort)
442  {
443  stringBuilder.Append(strPort);
444  }
445  else
446  {
447  stringBuilder.Append(':').Append(access.StrPort);
448  }
449  }
450  stringBuilder.Append("/.*");
451  return stringBuilder.ToString();
452  }
453 
454  internal PolicyStatement CalculatePolicy(string host, string scheme, string port)
455  {
456  SecurityElement securityElement = CreateWebPermission(host, scheme, port, null);
457  SecurityElement securityElement2 = new SecurityElement("PolicyStatement");
458  SecurityElement securityElement3 = new SecurityElement("PermissionSet");
459  securityElement3.AddAttribute("class", "System.Security.PermissionSet");
460  securityElement3.AddAttribute("version", "1");
461  if (securityElement != null)
462  {
463  securityElement3.AddChild(securityElement);
464  }
465  securityElement2.AddChild(securityElement3);
466  PolicyStatement policyStatement = new PolicyStatement();
467  policyStatement.FromXml(securityElement2);
468  return policyStatement;
469  }
470 
471  private PolicyStatement CalculateAssemblyPolicy(Evidence evidence)
472  {
473  PolicyStatement policyStatement = null;
474  Url hostEvidence = evidence.GetHostEvidence<Url>();
475  if (hostEvidence != null)
476  {
477  policyStatement = CalculatePolicy(hostEvidence.GetURLString().Host, hostEvidence.GetURLString().Scheme, hostEvidence.GetURLString().Port);
478  }
479  if (policyStatement == null)
480  {
481  Site hostEvidence2 = evidence.GetHostEvidence<Site>();
482  if (hostEvidence2 != null)
483  {
484  policyStatement = CalculatePolicy(hostEvidence2.Name, null, null);
485  }
486  }
487  if (policyStatement == null)
488  {
489  policyStatement = new PolicyStatement(new PermissionSet(fUnrestricted: false), PolicyStatementAttribute.Nothing);
490  }
491  return policyStatement;
492  }
493 
496  public override CodeGroup Copy()
497  {
498  NetCodeGroup netCodeGroup = new NetCodeGroup(base.MembershipCondition);
499  netCodeGroup.Name = base.Name;
500  netCodeGroup.Description = base.Description;
501  if (m_schemesList != null)
502  {
503  netCodeGroup.m_schemesList = (ArrayList)m_schemesList.Clone();
504  netCodeGroup.m_accessList = new ArrayList(m_accessList.Count);
505  for (int i = 0; i < m_accessList.Count; i++)
506  {
507  netCodeGroup.m_accessList.Add(((ArrayList)m_accessList[i]).Clone());
508  }
509  }
510  IEnumerator enumerator = base.Children.GetEnumerator();
511  while (enumerator.MoveNext())
512  {
513  netCodeGroup.AddChild((CodeGroup)enumerator.Current);
514  }
515  return netCodeGroup;
516  }
517 
522  public override bool Equals(object o)
523  {
524  if (this == o)
525  {
526  return true;
527  }
528  NetCodeGroup netCodeGroup = o as NetCodeGroup;
529  if (netCodeGroup == null || !base.Equals((object)netCodeGroup))
530  {
531  return false;
532  }
533  if (m_schemesList == null != (netCodeGroup.m_schemesList == null))
534  {
535  return false;
536  }
537  if (m_schemesList == null)
538  {
539  return true;
540  }
541  if (m_schemesList.Count != netCodeGroup.m_schemesList.Count)
542  {
543  return false;
544  }
545  for (int i = 0; i < m_schemesList.Count; i++)
546  {
547  int num = netCodeGroup.m_schemesList.IndexOf(m_schemesList[i]);
548  if (num == -1)
549  {
550  return false;
551  }
552  ArrayList arrayList = (ArrayList)m_accessList[i];
553  ArrayList arrayList2 = (ArrayList)netCodeGroup.m_accessList[num];
554  if (arrayList.Count != arrayList2.Count)
555  {
556  return false;
557  }
558  for (int j = 0; j < arrayList.Count; j++)
559  {
560  if (!arrayList2.Contains(arrayList[j]))
561  {
562  return false;
563  }
564  }
565  }
566  return true;
567  }
568 
571  public override int GetHashCode()
572  {
573  return base.GetHashCode() + GetRulesHashCode();
574  }
575 
576  private int GetRulesHashCode()
577  {
578  if (m_schemesList == null)
579  {
580  return 0;
581  }
582  int num = 0;
583  for (int i = 0; i < m_schemesList.Count; i++)
584  {
585  num += ((string)m_schemesList[i]).GetHashCode();
586  }
587  foreach (ArrayList access in m_accessList)
588  {
589  for (int j = 0; j < access.Count; j++)
590  {
591  num += ((CodeConnectAccess)access[j]).GetHashCode();
592  }
593  }
594  return num;
595  }
596 
597  protected override void CreateXml(SecurityElement element, PolicyLevel level)
598  {
599  DictionaryEntry[] connectAccessRules = GetConnectAccessRules();
600  if (connectAccessRules == null)
601  {
602  return;
603  }
604  SecurityElement securityElement = new SecurityElement("connectAccessRules");
605  DictionaryEntry[] array = connectAccessRules;
606  for (int i = 0; i < array.Length; i++)
607  {
608  DictionaryEntry dictionaryEntry = array[i];
609  SecurityElement securityElement2 = new SecurityElement("codeOrigin");
610  securityElement2.AddAttribute("scheme", (string)dictionaryEntry.Key);
611  CodeConnectAccess[] array2 = (CodeConnectAccess[])dictionaryEntry.Value;
612  foreach (CodeConnectAccess codeConnectAccess in array2)
613  {
614  SecurityElement securityElement3 = new SecurityElement("connectAccess");
615  securityElement3.AddAttribute("scheme", codeConnectAccess.Scheme);
616  securityElement3.AddAttribute("port", codeConnectAccess.StrPort);
617  securityElement2.AddChild(securityElement3);
618  }
619  securityElement.AddChild(securityElement2);
620  }
621  element.AddChild(securityElement);
622  }
623 
624  protected override void ParseXml(SecurityElement e, PolicyLevel level)
625  {
627  SecurityElement securityElement = e.SearchForChildByTag("connectAccessRules");
628  if (securityElement == null || securityElement.Children == null)
629  {
630  SetDefaults();
631  }
632  else
633  {
634  foreach (SecurityElement child in securityElement.Children)
635  {
636  if (child.Tag.Equals("codeOrigin"))
637  {
638  string originScheme = child.Attribute("scheme");
639  bool flag = false;
640  if (child.Children != null)
641  {
642  foreach (SecurityElement child2 in child.Children)
643  {
644  if (child2.Tag.Equals("connectAccess"))
645  {
646  string allowScheme = child2.Attribute("scheme");
647  string allowPort = child2.Attribute("port");
648  AddConnectAccess(originScheme, new CodeConnectAccess(allowScheme, allowPort));
649  flag = true;
650  }
651  }
652  }
653  if (!flag)
654  {
655  AddConnectAccess(originScheme, null);
656  }
657  }
658  }
659  }
660  }
661 
662  internal override string GetTypeName()
663  {
664  return "System.Security.Policy.NetCodeGroup";
665  }
666 
667  private void SetDefaults()
668  {
669  AddConnectAccess("file", null);
670  AddConnectAccess("http", new CodeConnectAccess("http", CodeConnectAccess.OriginPort));
671  AddConnectAccess("http", new CodeConnectAccess("https", CodeConnectAccess.OriginPort));
672  AddConnectAccess("https", new CodeConnectAccess("https", CodeConnectAccess.OriginPort));
673  AddConnectAccess(AbsentOriginScheme, CodeConnectAccess.CreateAnySchemeAccess(CodeConnectAccess.OriginPort));
674  AddConnectAccess(AnyOtherOriginScheme, CodeConnectAccess.CreateOriginSchemeAccess(CodeConnectAccess.OriginPort));
675  }
676  }
677 }
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Definition: CultureInfo.cs:263
abstract CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
When overridden in a derived class, resolves matching code groups.
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Specifies that the object graph is being cloned. Users can assume that the cloned graph will continue...
override void CreateXml(SecurityElement element, PolicyLevel level)
When overridden in a derived class, serializes properties and internal state specific to a derived co...
bool MoveNext()
Advances the enumerator to the next element of the collection.
unsafe override string ToString()
Converts the value of this instance to a T:System.String.
override void ParseXml(SecurityElement e, PolicyLevel level)
When overridden in a derived class, reconstructs properties and internal state specific to a derived ...
void AddConnectAccess(string originScheme, CodeConnectAccess connectAccess)
Adds the specified connection access to the current code group.
Represents the security policy levels for the common language runtime. This class cannot be inherited...
Definition: PolicyLevel.cs:15
virtual int Count
Gets the number of elements actually contained in the T:System.Collections.ArrayList.
Definition: ArrayList.cs:2255
Definition: __Canon.cs:3
The exception that is thrown when the value of an argument is outside the allowable range of values a...
PolicyStatementAttribute
Defines special attribute flags for security policy on code groups.
override string PermissionSetName
Gets the name of the T:System.Security.NamedPermissionSet for the code group.
Definition: NetCodeGroup.cs:53
string Name
Gets or sets the name of the code group.
Definition: CodeGroup.cs:128
SecurityElement SearchForChildByTag(string tag)
Finds a child by its tag name.
static readonly string AbsentOriginScheme
Contains a value used to specify connection access for code with an unknown or unrecognized origin sc...
Definition: NetCodeGroup.cs:45
void ResetConnectAccess()
Removes all connection access information for the current code group.
Definition: NetCodeGroup.cs:88
virtual object Clone()
Creates a shallow copy of the T:System.Collections.ArrayList.
Definition: ArrayList.cs:2473
Grants Web permission to the site from which the assembly was downloaded. This class cannot be inheri...
Definition: NetCodeGroup.cs:13
Describes the source and destination of a given serialized stream, and provides an additional caller-...
string Tag
Gets or sets the tag name of an XML element.
Represents the statement of a T:System.Security.Policy.CodeGroup describing the permissions and other...
void AddChild(CodeGroup group)
Adds a child code group to the current code group.
Definition: CodeGroup.cs:240
static readonly string AnyScheme
Contains the string value that represents the scheme wildcard.
void AddChild(SecurityElement child)
Adds a child element to the XML element.
Provides information about, and means to manipulate, the current environment and platform....
Definition: Environment.cs:21
StringBuilder Append(char value, int repeatCount)
Appends a specified number of copies of the string representation of a Unicode character to this inst...
IList Children
Gets or sets an ordered list of the child code groups of a code group.
Definition: CodeGroup.cs:32
virtual bool Contains(object item)
Determines whether an element is in the T:System.Collections.ArrayList.
Definition: ArrayList.cs:2486
Specifies the network resource access that is granted to code.
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.
string Description
Gets or sets the description of the code group.
Definition: CodeGroup.cs:142
object Current
Gets the element in the collection at the current position of the enumerator.
Definition: IEnumerator.cs:15
Represents the abstract base class from which all implementations of code groups must derive.
Definition: CodeGroup.cs:11
PolicyStatement PolicyStatement
Gets or sets the policy statement associated with the code group.
Definition: CodeGroup.cs:99
override PolicyStatement Resolve(Evidence evidence)
Resolves policy for the code group and its descendants for a set of evidence.
Represents a mutable string of characters. This class cannot be inherited.To browse the ....
virtual int Add(object value)
Adds an object to the end of the T:System.Collections.ArrayList.
Definition: ArrayList.cs:2381
override CodeGroup ResolveMatchingCodeGroups(Evidence evidence)
Resolves matching code groups.
override int GetHashCode()
Gets the hash code of the current code group.
NetCodeGroup(IMembershipCondition membershipCondition)
Initializes a new instance of the T:System.Security.Policy.NetCodeGroup class.
Definition: NetCodeGroup.cs:81
override string MergeLogic
Gets the logic to use for merging groups.
Definition: NetCodeGroup.cs:49
Defines the set of information that constitutes input to security policy decisions....
Definition: Evidence.cs:17
object Value
Gets or sets the value in the key/value pair.
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.
static readonly string AnyOtherOriginScheme
Contains a value used to specify any other unspecified origin scheme.
Definition: NetCodeGroup.cs:42
object Key
Gets or sets the key in the key/value pair.
Provides information about a specific culture (called a locale for unmanaged code development)....
Definition: CultureInfo.cs:16
virtual int IndexOf(object value)
Searches for the specified T:System.Object and returns the zero-based index of the first occurrence w...
Definition: ArrayList.cs:2649
Defines a dictionary key/value pair that can be set or retrieved.
PolicyStatementAttribute Attributes
Gets or sets the attributes of the policy statement.
override bool Equals(object o)
Determines whether the specified code group is equivalent to the current code group.
override CodeGroup Copy()
Makes a deep copy of the current code group.
Supports a simple iteration over a non-generic collection.
Definition: IEnumerator.cs:9
override string AttributeString
Gets a string representation of the attributes of the policy statement for the code group.
Definition: NetCodeGroup.cs:57
virtual object [] ToArray()
Copies the elements of the T:System.Collections.ArrayList to a new T:System.Object array.
Definition: ArrayList.cs:3083
Implements the T:System.Collections.IList interface using an array whose size is dynamically increase...
Definition: ArrayList.cs:14
DictionaryEntry [] GetConnectAccessRules()
Gets the connection access information for the current code group.