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

◆ CanResetValue()

override bool System.ComponentModel.ReflectPropertyDescriptor.CanResetValue ( object component)
inline

Definition at line 573 of file ReflectPropertyDescriptor.cs.

574 {
575 if (IsExtender || IsReadOnly)
576 {
577 return false;
578 }
579 if (DefaultValue != s_noValue)
580 {
581 return !object.Equals(GetValue(component), DefaultValue);
582 }
583 if (ResetMethodValue != null)
584 {
585 if (ShouldSerializeMethodValue != null)
586 {
587 component = GetInvocationTarget(_componentClass, component);
588 try
589 {
590 return (bool)ShouldSerializeMethodValue.Invoke(component, null);
591 }
592 catch
593 {
594 }
595 }
596 return true;
597 }
598 if (AmbientValue != s_noValue)
599 {
600 return ShouldSerializeValue(component);
601 }
602 return false;
603 }
override? object GetInvocationTarget(Type type, object instance)
object? Invoke(object? obj, object?[]? parameters)

References System.ComponentModel.ReflectPropertyDescriptor._componentClass, System.ComponentModel.ReflectPropertyDescriptor.AmbientValue, System.ComponentModel.ReflectPropertyDescriptor.DefaultValue, System.ComponentModel.PropertyDescriptor.GetInvocationTarget(), System.ComponentModel.ReflectPropertyDescriptor.GetValue(), System.Reflection.MethodBase.Invoke(), System.ComponentModel.ReflectPropertyDescriptor.IsExtender, System.ComponentModel.ReflectPropertyDescriptor.IsReadOnly, System.ComponentModel.ReflectPropertyDescriptor.ResetMethodValue, System.ComponentModel.ReflectPropertyDescriptor.s_noValue, System.ComponentModel.ReflectPropertyDescriptor.ShouldSerializeMethodValue, and System.ComponentModel.ReflectPropertyDescriptor.ShouldSerializeValue().