System.ComponentModel.ReflectPropertyDescriptor.CanResetValue C# (CSharp) Method

CanResetValue() public method

Indicates whether reset will change the value of the component. If there is a DefaultValueAttribute, then this will return true if getValue returns something different than the default value. If there is a reset method and a ShouldSerialize method, this will return what ShouldSerialize returns. If there is just a reset method, this always returns true. If none of these cases apply, this returns false.
public CanResetValue ( object component ) : bool
component object
return bool
        public override bool CanResetValue(object component)
        {
            if (IsExtender || IsReadOnly)
            {
                return false;
            }

            if (DefaultValue != s_noValue)
            {
                return !object.Equals(GetValue(component), DefaultValue);
            }

            if (ResetMethodValue != null)
            {
                if (ShouldSerializeMethodValue != null)
                {
                    component = GetInvocationTarget(_componentClass, component);
                    try
                    {
                        return (bool)ShouldSerializeMethodValue.Invoke(component, null);
                    }
                    catch { }
                }
                return true;
            }

            if (AmbientValue != s_noValue)
            {
                return ShouldSerializeValue(component);
            }

            return false;
        }