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

◆ DefaultValue

object System.ComponentModel.ReflectPropertyDescriptor.DefaultValue
getprivate

Definition at line 112 of file ReflectPropertyDescriptor.cs.

113 {
114 get
115 {
117 {
118 Attribute attribute = Attributes[typeof(DefaultValueAttribute)];
119 if (attribute != null)
120 {
121 object value = ((DefaultValueAttribute)attribute).Value;
122 bool flag = value != null && PropertyType.IsEnum && PropertyType.GetEnumUnderlyingType() == value.GetType();
123 _defaultValue = (flag ? Enum.ToObject(PropertyType, value) : value);
124 }
125 else
126 {
128 }
130 }
131 return _defaultValue;
132 }
133 }
virtual AttributeCollection Attributes
static ? Type GetType(string typeName, bool throwOnError, bool ignoreCase)
Definition Type.cs:408
virtual Type GetEnumUnderlyingType()
Definition Type.cs:1035

Referenced by System.ComponentModel.ReflectPropertyDescriptor.CanResetValue(), System.ComponentModel.ReflectPropertyDescriptor.ExtenderCanResetValue(), System.ComponentModel.ReflectPropertyDescriptor.ExtenderResetValue(), and System.ComponentModel.ReflectPropertyDescriptor.ExtenderShouldSerializeValue().