C# Class System.ComponentModel.PropertyDescriptor

Inheritance: MemberDescriptor
Datei anzeigen Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
AddValueChanged ( object component, EventHandler handler ) : void

Allows interested objects to be notified when this property changes.

CanResetValue ( object component ) : bool

When overridden in a derived class, indicates whether resetting the component will change the value of the component.

Equals ( object obj ) : bool

Compares this to another to see if they are equivalent. NOTE: If you make a change here, you likely need to change GetHashCode() as well.

GetChildProperties ( ) : PropertyDescriptorCollection

[To be supplied.]

GetChildProperties ( Attribute filter ) : PropertyDescriptorCollection

[To be supplied.]

GetChildProperties ( object instance ) : PropertyDescriptorCollection

[To be supplied.]

GetChildProperties ( object instance, Attribute filter ) : PropertyDescriptorCollection

Retrieves the properties

GetEditor ( Type editorBaseType ) : object

Gets an editor of the specified type.

GetHashCode ( ) : int

Try to keep this reasonable in [....] with Equals(). Specifically, if A.Equals(B) returns true, A & B should have the same hash code.

GetValue ( object component ) : object

When overridden in a derived class, gets the current value of the property on a component.

RemoveValueChanged ( object component, EventHandler handler ) : void

Allows interested objects to be notified when this property changes.

ResetValue ( object component ) : void

When overridden in a derived class, resets the value for this property of the component.

SetValue ( object component, object value ) : void

When overridden in a derived class, sets the value of the component to a different value.

ShouldSerializeValue ( object component ) : bool

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

Protected Methods

Method Description
CreateInstance ( Type type ) : object

Creates an instance of the specified type.

FillAttributes ( IList attributeList ) : void

In an inheriting class, adds the attributes of the inheriting class to the specified list of attributes in the parent class. For duplicate attributes, the last one added to the list will be kept.

GetInvocationTarget ( Type type, object instance ) : object

This method returns the object that should be used during invocation of members. Normally the return value will be the same as the instance passed in. If someone associated another object with this instance, or if the instance is a custom type descriptor, GetInvocationTarget may return a different value.

GetTypeFromName ( string typeName ) : Type

Gets a type using its name.

GetValueChangedHandler ( object component ) : EventHandler

Return current set of ValueChanged event handlers for a specific component, in the form of a combined multicast event handler. Returns null if no event handlers currently assigned to component.

PropertyDescriptor ( MemberDescriptor descr ) : System.Collections

Initializes a new instance of the class with the name and attributes in the specified .

PropertyDescriptor ( MemberDescriptor descr, Attribute attrs ) : System.Collections

Initializes a new instance of the class with the name in the specified and the attributes in both the and the array.

PropertyDescriptor ( string name, Attribute attrs ) : System.Collections

Initializes a new instance of the class with the specified name and attributes.

Private Methods

Method Description
OnValueChanged ( object component, EventArgs e ) : void

Method Details

AddValueChanged() public method

Allows interested objects to be notified when this property changes.
public AddValueChanged ( object component, EventHandler handler ) : void
component object
handler EventHandler
return void

CanResetValue() public abstract method

When overridden in a derived class, indicates whether resetting the component will change the value of the component.

public abstract CanResetValue ( object component ) : bool
component object
return bool

CreateInstance() protected method

Creates an instance of the specified type.

protected CreateInstance ( Type type ) : object
type System.Type
return object

Equals() public method

Compares this to another to see if they are equivalent. NOTE: If you make a change here, you likely need to change GetHashCode() as well.

public Equals ( object obj ) : bool
obj object
return bool

FillAttributes() protected method

In an inheriting class, adds the attributes of the inheriting class to the specified list of attributes in the parent class. For duplicate attributes, the last one added to the list will be kept.
protected FillAttributes ( IList attributeList ) : void
attributeList IList
return void

GetChildProperties() public method

[To be supplied.]

public GetChildProperties ( ) : PropertyDescriptorCollection
return PropertyDescriptorCollection

GetChildProperties() public method

[To be supplied.]

public GetChildProperties ( Attribute filter ) : PropertyDescriptorCollection
filter System.Attribute
return PropertyDescriptorCollection

GetChildProperties() public method

[To be supplied.]

public GetChildProperties ( object instance ) : PropertyDescriptorCollection
instance object
return PropertyDescriptorCollection

GetChildProperties() public method

Retrieves the properties
public GetChildProperties ( object instance, Attribute filter ) : PropertyDescriptorCollection
instance object
filter System.Attribute
return PropertyDescriptorCollection

GetEditor() public method

Gets an editor of the specified type.

public GetEditor ( Type editorBaseType ) : object
editorBaseType System.Type
return object

GetHashCode() public method

Try to keep this reasonable in [....] with Equals(). Specifically, if A.Equals(B) returns true, A & B should have the same hash code.
public GetHashCode ( ) : int
return int

GetInvocationTarget() protected method

This method returns the object that should be used during invocation of members. Normally the return value will be the same as the instance passed in. If someone associated another object with this instance, or if the instance is a custom type descriptor, GetInvocationTarget may return a different value.
protected GetInvocationTarget ( Type type, object instance ) : object
type System.Type
instance object
return object

GetTypeFromName() protected method

Gets a type using its name.

protected GetTypeFromName ( string typeName ) : Type
typeName string
return System.Type

GetValue() public abstract method

When overridden in a derived class, gets the current value of the property on a component.

public abstract GetValue ( object component ) : object
component object
return object

GetValueChangedHandler() protected method

Return current set of ValueChanged event handlers for a specific component, in the form of a combined multicast event handler. Returns null if no event handlers currently assigned to component.
protected GetValueChangedHandler ( object component ) : EventHandler
component object
return EventHandler

PropertyDescriptor() protected method

Initializes a new instance of the class with the name and attributes in the specified .

protected PropertyDescriptor ( MemberDescriptor descr ) : System.Collections
descr MemberDescriptor
return System.Collections

PropertyDescriptor() protected method

Initializes a new instance of the class with the name in the specified and the attributes in both the and the array.

protected PropertyDescriptor ( MemberDescriptor descr, Attribute attrs ) : System.Collections
descr MemberDescriptor
attrs System.Attribute
return System.Collections

PropertyDescriptor() protected method

Initializes a new instance of the class with the specified name and attributes.

protected PropertyDescriptor ( string name, Attribute attrs ) : System.Collections
name string
attrs System.Attribute
return System.Collections

RemoveValueChanged() public method

Allows interested objects to be notified when this property changes.
public RemoveValueChanged ( object component, EventHandler handler ) : void
component object
handler EventHandler
return void

ResetValue() public abstract method

When overridden in a derived class, resets the value for this property of the component.

public abstract ResetValue ( object component ) : void
component object
return void

SetValue() public abstract method

When overridden in a derived class, sets the value of the component to a different value.

public abstract SetValue ( object component, object value ) : void
component object
value object
return void

ShouldSerializeValue() public abstract method

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

public abstract ShouldSerializeValue ( object component ) : bool
component object
return bool