Name

PropertyDescriptor

Synopsis

This is an abstract base class derived from MemberDescriptor for objects that encapsulate information about a property.

In addition to the base attribute utilities, you can determine whether the property IsLocalizable or IsReadOnly. You can also check the SerializationVisibility. ShouldSerializeValue() can be used to determine whether the property of a particular component should be serialized. The default implementation of this method uses DefaultValueAttribute or a ShouldSerialize[PropertyName] method to determine whether it is necessary to serialize the property. See DefaultValueAttribute for more information on this.

You can also use ComponentType to determine the type of the component to which this property belongs. Converter retrieves a TypeConverter and GetEditor() gets a custom editor of the specified base type (in case several types of editor are defined for the property).

AddValueChanged() and RemoveValueChanged() allow you to bind an event handler, to be notified when the property changes. You can use GetValue(), SetValue(), and ResetValue() to access and modify that value. PropertyType indicates the type of that value.

If this is a parent property, you can retrieve the PropertyDescriptor objects for the children with the GetChildProperties() member.


public abstract class PropertyDescriptor : MemberDescriptor {

// Protected Constructors

   protected PropertyDescriptor(MemberDescriptor descr);

   protected PropertyDescriptor(MemberDescriptor descr ...

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.