ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

Tweaks:

  • TypeDescriptionProvider

    • still replaces metadata (not extends)
    • can also be added be TypeDescriptor.AddProvider
    • can be applied per-type as well as per-instance, making it possible to apply to lists without having to implement ITypedList
  • TypeConverter

    • for PropertyGrid, this is also the mechanism used to obtain metadata; note that ExpandableObjectConverter simply delegates to TypeDescriptor.GetProperties, but this is not always the case
    • also responsible for re-creating immutable objects (such as structs) with changes
  • UITypeEditor

    • also responsible for painting the preview box in PropertyGrid

Additional:

  • IExtenderProviderappends 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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)