I'm trying to get an overall understanding of how you use ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor to change how a PropertyGrid displays and interfaces with an object.
Can someone tell me if this is right, or if I missed any major concepts or points? I'm really just trying to understand why and when you would use each class.
ICustomTypeDescriptor
TypeDescriptionProvider
TypeConverter
UITypeEditor
So ICustomTypeDescriptor an TypeDescription provider are used to add/change/replace entire properties of objects. TypeConverter and UITypeEditor are applied to individual properties and control how those specific properties are interfaced with.
Tweaks:
TypeDescriptionProvider
TypeDescriptor.AddProvider
ITypedList
TypeConverter
PropertyGrid
, this is also the mechanism used to obtain metadata; note that ExpandableObjectConverter
simply delegates to TypeDescriptor.GetProperties
, but this is not always the caseUITypeEditor
PropertyGrid
Additional:
IExtenderProvider
- appends properties; this may be what you were getting confused with TypeDescriptionProvider
ITypedList
- broadly the twin of ICustomTypeDescriptor
, but for lists; can be avoided by use of TypeDescriptionProvider
and a non-object indexer on any IList
, i.e. public T this[int index] {get;}
IListSource
- provides indirection between a data-source and the data; for example, a DataTable
implements IListSource
, returning DefaultView
when requested