Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Attributes

Hashtable? System.Security.SecurityElement.Attributes
getset

Definition at line 47 of file SecurityElement.cs.

48 {
49 get
50 {
51 if (_attributes == null || _attributes.Count == 0)
52 {
53 return null;
54 }
55 Hashtable hashtable = new Hashtable(_attributes.Count / 2);
57 for (int i = 0; i < count; i += 2)
58 {
59 hashtable.Add(_attributes[i], _attributes[i + 1]);
60 }
61 return hashtable;
62 }
63 set
64 {
65 if (value == null || value.Count == 0)
66 {
67 _attributes = null;
68 return;
69 }
70 ArrayList arrayList = new ArrayList(value.Count);
71 IDictionaryEnumerator enumerator = value.GetEnumerator();
72 while (enumerator.MoveNext())
73 {
74 string text = (string)enumerator.Key;
75 string text2 = (string)enumerator.Value;
77 {
78 throw new ArgumentException(SR.Format(SR.Argument_InvalidElementName, text));
79 }
80 if (!IsValidAttributeValue(text2))
81 {
82 throw new ArgumentException(SR.Format(SR.Argument_InvalidElementValue, text2));
83 }
84 arrayList.Add(text);
85 arrayList.Add(text2);
86 }
87 _attributes = arrayList;
88 }
89 }
virtual int Add(object? value)
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static bool IsValidAttributeValue([NotNullWhen(true)] string? value)
static bool IsValidAttributeName([NotNullWhen(true)] string? name)