In This Article

CollectionPropertyDescriptorPropertyModel Class

Represents a property grid collection property IDataModel that is based on PropertyDescriptor data.

public class CollectionPropertyDescriptorPropertyModel : PropertyDescriptorPropertyModel, IPropertyModel, IDataModel, IDisposable, IServiceProvider
Inheritance:
object ObservableObjectBase DataModelBase PropertyModelBase CachedPropertyModelBase PropertyDescriptorPropertyModel object
Implements:
IPropertyModel IDataModel IDisposable IServiceProvider

Constructors

CollectionPropertyDescriptorPropertyModel(object, PropertyDescriptor, bool, bool)

Initializes an instance of the CollectionPropertyDescriptorPropertyModel class.

public CollectionPropertyDescriptorPropertyModel(object target, PropertyDescriptor propertyDescriptor, bool isCollectionReadOnly, bool areItemsReadOnly)
Parameter Type Description
target object

The target object that owns the property.

propertyDescriptor PropertyDescriptor

The PropertyDescriptor for the property be accessed on the target.

isCollectionReadOnly bool

Whether items can be added to or removed from the collection.

areItemsReadOnly bool

Whether the values of the items in the collection are read-only and cannot be changed.

Properties

AreItemsReadOnly

Gets whether the values of the items in the collection are read-only and cannot be changed.

public bool AreItemsReadOnly { get; }

Property Value

bool:

true if the values of the items in the collection are read-only and cannot be changed; otherwise, false.

AttachedCollectionValue

Gets or sets the collection object that is attached for change notification, if any.

public object AttachedCollectionValue { get; set; }

Property Value

object:

The collection object that is attached for change notification, if any.

CanAddChildCore

Gets whether a new child can be added to an associated collection/parent.

protected override bool CanAddChildCore { get; }

Property Value

bool:

true if a new child can be added to an associated collection/parent; otherwise, false.

Remarks

This property does the actual work of retrieving the value for the cached version of this property.

ConverterCore

Gets the TypeConverter to use for the property.

protected override TypeConverter ConverterCore { get; }

Property Value

TypeConverter:

The TypeConverter to use for the property.

Remarks

This property does the actual work of retrieving the value for the cached version of this property.

IsCollectionReadOnly

Gets whether items can be added to or removed from the collection.

public bool IsCollectionReadOnly { get; }

Property Value

bool:

true if items can be added to or removed from the collection; otherwise, false.

Methods

AddChild()

Adds a new child into to an associated collection/parent.

public override void AddChild()

CreateExpandableCollectionConverter()

Creates a new expandable collection TypeConverter.

protected virtual TypeConverter CreateExpandableCollectionConverter()

Returns

TypeConverter:

The TypeConverter that was created.

Remarks

The default implementation of this method creates an ExpandableCollectionConverter instance.

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected override void Dispose(bool disposing)
Parameter Type Description
disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose method and the Finalize method. Dispose invokes this method with the disposing parameter set to true. Finalize invokes this method with disposing set to false.

OnPropertyChanged(PropertyChangedEventArgs)

Raises the PropertyChanged event.

protected override void OnPropertyChanged(PropertyChangedEventArgs e)
Parameter Type Description
e PropertyChangedEventArgs

The PropertyChangedEventArgs that contains the event data.

Inherited Members