Uses a PropertyDescriptor to expose property metadata and read or write its value.
Definition
Namespace:Telerik.WinControls.UI.PropertyGridData
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class DescriptorItemAccessor : ItemAccessor, IItemAccessor
Inheritance: objectItemAccessorDescriptorItemAccessor
Derived Classes:
Implements:
Inherited Members
Constructors
Associates the descriptor with the property-grid item that represents its property.
public DescriptorItemAccessor(PropertyGridItem owner, PropertyDescriptor descriptor)
The item that uses this accessor.
descriptorPropertyDescriptorThe descriptor supplying property metadata and value access.
Properties
Gets a collection of the attributes applied to the property.
public override AttributeCollection Attributes { get; }
Overrides:
Gets the descriptor category, falling back to the base accessor's default category when it is empty.
public override string Category { get; }
Overrides:
Gets or sets the description associated with this property.
public override string Description { get; }
Overrides:
Gets the property display name
public override string DisplayName { get; }
Overrides:
Gets the property descriptor for this property.
public override PropertyDescriptor PropertyDescriptor { get; }
Overrides:
Gets the property type.
public override Type PropertyType { get; }
Overrides:
Gets a value indicating whether the property is editable.
public override bool ReadOnly { get; }
Overrides:
Gets the descriptor's converter when available, otherwise using the base accessor's type-based lookup.
public override TypeConverter TypeConverter { get; }
Overrides:
Gets the editor provided by the descriptor, falling back to the base accessor's type-based editor lookup.
public override UITypeEditor UITypeEditor { get; }
Overrides:
Reads or writes the descriptor value.
public override object Value { get; set; }
Overrides:
On the direct-owner path, a read failure is returned as an Exception object, while a write failure is displayed through RadMessageBox and is not rethrown. The multi-object helpers absorb per-object errors; failed or inconsistent reads produce null, and failed writes do not display this dialog.
Methods
Reads the descriptor value from a target or resolves a common value across the selected objects.
protected virtual object GetPropertyValueCore(object target)
The value owner, or null when a multi-object owner may be resolved.
Returns:The property value; null when the descriptor is absent or selected values cannot be resolved consistently.
If the target implements ICustomTypeDescriptor, its property owner is used for the read.
Writes the descriptor value to its owner or attempts the write for each selected object in a multi-object selection.
protected virtual void SetPropertyValueCore(object obj, object value)
The value owner, or null when resolving a multi-object selection.
valueobjectThe value to write.
On the direct-owner path, if the parent property is a value type or array, the updated owner is also assigned back to the parent item. The multi-object path does not perform that reassignment.