NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

PropertyDescriptor.ShouldPersistValue

When overridden in a derived class, indicates whether the value of this property needs to be persisted.

[Visual Basic]
MustOverride Public Function ShouldPersistValue( _
   ByVal component As Object _
) As Boolean
[C#]
public abstract bool ShouldPersistValue(
   object component
);
[C++]
public: virtual bool ShouldPersistValue(
   Object* component
) = 0;
[JScript]
public abstract function ShouldPersistValue(
   component : Object
) : Boolean;

Parameters

component
The component with the property will be examined for persistance.

Return Value

true when the property should be persisted; otherwise, false.

Remarks

Typically, this method is implemented through reflection.

Notes to Inheritors: When overridden in a derived class, this method returns true if the current value of the property is different than its default value. It looks for a default value by first looking for a DefaultValueAttribute. If the method finds this attribute, it compares the value of the attribute with the property's current value. If this method cannot find a DefaultValueAttribute, it looks for a ShouldPersist XXX method. If this method finds a ShouldPersist XXX method, it invokes it. If this method cannot find a DefaultValueAttribute or a ShouldPersist XXX method, it cannot create optimizations and it returns true.

See Also

PropertyDescriptor Class | PropertyDescriptor Members | System.ComponentModel Namespace