Breyta

Deila með


TypeConverter.SimplePropertyDescriptor.CanResetValue(Object) Method

Definition

Returns whether resetting the component changes the value of the component.

public:
 override bool CanResetValue(System::Object ^ component);
public override bool CanResetValue (object component);
override this.CanResetValue : obj -> bool
Public Overrides Function CanResetValue (component As Object) As Boolean

Parameters

component
Object

The component to test for reset capability.

Returns

true if resetting the component changes the value of the component; otherwise, false.

Remarks

This method looks for a DefaultValueAttribute. If it finds one, it compares the value of the attribute with the current value of the property. It returns true when the default value does not match the current value of the property. If this method cannot find a DefaultValueAttribute, it looks for a ShouldSerializeMyProperty method. If it finds a ShouldSerializeMyProperty method, it returns what ShouldSerializeMyProperty returns. If this method cannot find a ShouldSerializeMyProperty method, it looks for a ResetMyProperty method. If it finds a ResetMyProperty method, it returns true. If this method cannot find a DefaultValueAttribute, a ShouldSerializeMyProperty method, or a ResetMyProperty method, then it returns false.

Applies to

See also