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

◆ GetStandardValues() [2/2]

override StandardValuesCollection System.ComponentModel.EnumConverter.GetStandardValues ( ITypeDescriptorContext? context)
inlinevirtual

Reimplemented from System.ComponentModel.TypeConverter.

Definition at line 177 of file EnumConverter.cs.

178 {
179 if (Values == null)
180 {
181 Type type = TypeDescriptor.GetReflectionType(EnumType) ?? EnumType;
182 FieldInfo[] fields = type.GetFields(BindingFlags.Static | BindingFlags.Public);
183 ArrayList arrayList = null;
184 if (fields != null && fields.Length != 0)
185 {
186 arrayList = new ArrayList(fields.Length);
187 }
188 if (arrayList != null)
189 {
190 FieldInfo[] array = fields;
191 foreach (FieldInfo fieldInfo in array)
192 {
193 BrowsableAttribute browsableAttribute = null;
194 object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(BrowsableAttribute), inherit: false);
195 for (int j = 0; j < customAttributes.Length; j++)
196 {
198 browsableAttribute = attribute as BrowsableAttribute;
199 }
200 if (browsableAttribute != null && !browsableAttribute.Browsable)
201 {
202 continue;
203 }
204 object obj = null;
205 try
206 {
207 if (fieldInfo.Name != null)
208 {
209 obj = Enum.Parse(EnumType, fieldInfo.Name);
210 }
211 }
212 catch (ArgumentException)
213 {
214 }
215 if (obj != null)
216 {
218 }
219 }
221 if (comparer != null)
222 {
223 arrayList.Sort(comparer);
224 }
225 }
226 Array values = arrayList?.ToArray();
227 Values = new StandardValuesCollection(values);
228 }
229 return Values;
230 }
void Add(TKey key, TValue value)
StandardValuesCollection? Values

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.array, System.ComponentModel.EnumConverter.Comparer, System.comparer, System.ComponentModel.EnumConverter.EnumType, System.ComponentModel.TypeDescriptor.GetReflectionType(), System.obj, System.Enum.Parse(), System.type, System.ComponentModel.EnumConverter.Values, and System.values.