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

◆ this[object key]

object? IDictionary. System.ComponentModel.PropertyDescriptorCollection.this[object key]
getsetprivate

Definition at line 97 of file PropertyDescriptorCollection.cs.

98 {
99 get
100 {
101 if (key is string)
102 {
103 return this[(string)key];
104 }
105 return null;
106 }
107 set
108 {
109 if (_readOnly)
110 {
111 throw new NotSupportedException();
112 }
113 if (value != null && !(value is PropertyDescriptor))
114 {
115 throw new ArgumentException("value");
116 }
117 int num = -1;
118 if (key is int)
119 {
120 num = (int)key;
122 {
123 throw new IndexOutOfRangeException();
124 }
125 }
126 else
127 {
128 if (!(key is string))
129 {
130 throw new ArgumentException("key");
131 }
132 for (int i = 0; i < Count; i++)
133 {
134 if (_properties[i].Name.Equals((string)key))
135 {
136 num = i;
137 break;
138 }
139 }
140 }
141 if (num == -1)
142 {
143 Add((PropertyDescriptor)value);
144 return;
145 }
147 _properties[num] = (PropertyDescriptor)value;
148 if (_cachedFoundProperties != null && key is string)
149 {
151 }
152 }
153 }
override bool Equals([NotNullWhen(true)] object? obj)