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

◆ ReflectPropertyDescriptor() [4/4]

System.ComponentModel.ReflectPropertyDescriptor.ReflectPropertyDescriptor ( [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass,
PropertyDescriptor oldReflectPropertyDescriptor,
Attribute[] attributes )
inline

Definition at line 327 of file ReflectPropertyDescriptor.cs.

328 : base(oldReflectPropertyDescriptor, attributes)
329 {
330 _componentClass = componentClass;
331 _type = oldReflectPropertyDescriptor.PropertyType;
332 if (componentClass == null)
333 {
334 throw new ArgumentException(System.SR.Format(System.SR.InvalidNullArgument, "componentClass"));
335 }
336 if (!(oldReflectPropertyDescriptor is ReflectPropertyDescriptor reflectPropertyDescriptor))
337 {
338 return;
339 }
340 if (reflectPropertyDescriptor.ComponentType == componentClass)
341 {
342 _propInfo = reflectPropertyDescriptor._propInfo;
343 _getMethod = reflectPropertyDescriptor._getMethod;
344 _setMethod = reflectPropertyDescriptor._setMethod;
345 _shouldSerializeMethod = reflectPropertyDescriptor._shouldSerializeMethod;
346 _resetMethod = reflectPropertyDescriptor._resetMethod;
347 _defaultValue = reflectPropertyDescriptor._defaultValue;
348 _ambientValue = reflectPropertyDescriptor._ambientValue;
349 _state = reflectPropertyDescriptor._state;
350 }
351 if (attributes == null)
352 {
353 return;
354 }
355 foreach (Attribute attribute in attributes)
356 {
357 if (attribute is DefaultValueAttribute defaultValueAttribute)
358 {
359 _defaultValue = defaultValueAttribute.Value;
361 {
363 }
365 }
366 else if (attribute is AmbientValueAttribute ambientValueAttribute)
367 {
368 _ambientValue = ambientValueAttribute.Value;
370 }
371 }
372 }
ReflectPropertyDescriptor([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type componentClass, string name, Type type, Attribute[] attributes)
static string InvalidNullArgument
Definition SR.cs:86
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
virtual bool IsEnum
Definition Type.cs:227
virtual Type GetEnumUnderlyingType()
Definition Type.cs:1035

References System.ComponentModel.ReflectPropertyDescriptor._ambientValue, System.ComponentModel.ReflectPropertyDescriptor._componentClass, System.ComponentModel.ReflectPropertyDescriptor._defaultValue, System.ComponentModel.ReflectPropertyDescriptor._getMethod, System.ComponentModel.ReflectPropertyDescriptor._propInfo, System.ComponentModel.ReflectPropertyDescriptor._resetMethod, System.ComponentModel.ReflectPropertyDescriptor._setMethod, System.ComponentModel.ReflectPropertyDescriptor._shouldSerializeMethod, System.ComponentModel.ReflectPropertyDescriptor._state, System.ComponentModel.ReflectPropertyDescriptor._type, System.ComponentModel.InterlockedBitVector32.DangerousSet(), System.SR.Format(), System.Type.GetEnumUnderlyingType(), System.SR.InvalidNullArgument, System.Type.IsEnum, System.ComponentModel.PropertyDescriptor.PropertyType, System.ComponentModel.ReflectPropertyDescriptor.PropertyType, System.ComponentModel.ReflectPropertyDescriptor.s_bitAmbientValueQueried, System.ComponentModel.ReflectPropertyDescriptor.s_bitDefaultValueQueried, System.Enum.ToObject(), and System.value.