ExpandableCollectionConverter.DictionaryItemPropertyDescriptor Class
Represents a System.ComponentModel.PropertyDescriptor for an item in a dictionary.
protected class DictionaryItemPropertyDescriptor : TypeConverter.SimplePropertyDescriptor, ICollectionItemPropertyDescriptor
- Inheritance:
- System.Object Object
- Implements:
- ICollectionItemPropertyDescriptor
Constructors
DictionaryItemPropertyDescriptor(IDictionary, Object, Type, Attribute[], Boolean, Boolean)
Initializes a new instance of the ExpandableCollectionConverter.DictionaryItemPropertyDescriptor class.
public DictionaryItemPropertyDescriptor(IDictionary dictionary, object key, Type itemType, Attribute[] attributes, bool isCollectionReadOnly, bool isReadOnly)
Parameter | Type | Description |
---|---|---|
dictionary | System.Collections.IDictionary | The dictionary associated with the item. |
key | System.Object | The key of the item in the dictionary. |
itemType | System.Type | Type of the item. |
attributes | Attribute[] | An |
isCollectionReadOnly | System.Boolean | Whether the dictionary is forced to be read-only, and this item cannot be removed from it. |
isReadOnly | System.Boolean | if set to |
Properties
CanRemove
Gets a value indicating whether the collection item can be removed.
public virtual bool CanRemove { get; }
Property Value
- System.Boolean:
true
if the collection item can be removed; otherwise,false
.
Dictionary
Gets the dictionary associated with this property descriptor.
public IDictionary Dictionary { get; }
Property Value
- System.Collections.IDictionary:
The dictionary associated with this property descriptor.
IsReadOnly
Gets a value indicating whether this property is read-only.
public override bool IsReadOnly { get; }
Property Value
- System.Boolean
Key
Gets the key of the dictionary item associated with this property descriptor.
public object Key { get; }
Property Value
- System.Object:
The key of the dictionary item associated with this property descriptor.
Methods
GetValue(Object)
When overridden in a derived class, gets the current value of the property on a component.
public override object GetValue(object component)
Parameter | Type | Description |
---|---|---|
component | System.Object | The component with the property for which to retrieve the value. |
Returns
- System.Object:
The value of a property for a given component.
Remove()
Removes this item from the associated collection.
public virtual bool Remove()
Returns
- System.Boolean:
true
if the item was removed; otherwise,false
.
SetValue(Object, Object)
When overridden in a derived class, sets the value of the component to a different value.
public override void SetValue(object component, object value)
Parameter | Type | Description |
---|---|---|
component | System.Object | The component with the property value that is to be set. |
value | System.Object | The new value. |