In This Article

CollectionPropertyDescriptorPropertyModel Class

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

public class CollectionPropertyDescriptorPropertyModel : PropertyDescriptorPropertyModel, INotifyPropertyChanged, IDataErrorInfo, IPropertyModel, IDataModel, IDisposable, ITypeDescriptorContext, IServiceProvider
Inheritance:
System.Object ObservableObjectBase DataModelBase PropertyModelBase CachedPropertyModelBase PropertyDescriptorPropertyModel Object
Implements:
IPropertyModel IDataModel System.IDisposable System.IServiceProvider

Constructors

CollectionPropertyDescriptorPropertyModel(Object, PropertyDescriptor, Boolean, Boolean)

Initializes an instance of the CollectionPropertyDescriptorPropertyModel class.

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

The target object that owns the property.

propertyDescriptor System.ComponentModel.PropertyDescriptor

The System.ComponentModel.PropertyDescriptor for the property be accessed on the target.

isCollectionReadOnly System.Boolean

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

areItemsReadOnly System.Boolean

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

System.Boolean:

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

System.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

System.Boolean:

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 System.ComponentModel.TypeConverter to use for the property.

protected override TypeConverter ConverterCore { get; }

Property Value

System.ComponentModel.TypeConverter:

The System.ComponentModel.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

System.Boolean:

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 System.ComponentModel.TypeConverter.

protected virtual TypeConverter CreateExpandableCollectionConverter()

Returns

System.ComponentModel.TypeConverter:

The System.ComponentModel.TypeConverter that was created.

Remarks

The default implementation of this method creates an ExpandableCollectionConverter instance.

Dispose(Boolean)

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

protected override void Dispose(bool disposing)
Parameter Type Description
disposing System.Boolean

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 System.ComponentModel.PropertyChangedEventArgs

The System.ComponentModel.PropertyChangedEventArgs that contains the event data.

Inherited Members