This class provides a means to translate between one type and other
representations of that type—typically a string representation.
The designer environment uses type converters to translate between
types it does not understand (for example, a
System.Drawing.Size) and one it can represent in a
System.Windows.Forms.PropertyGrid (for example, a
One of the quickest and simplest ways to make your custom type
available in a designer is to implement a
TypeConverter for it and adorn it with a
TypeConverterAttribute to bind the appropriate
converter. For finer control, you can add the attribute to a
particular property to change the type converter for that particular
instance of the type.
To implement a
TypeConverter you should override
ConvertTo() methods. At a minimum, you should
implement conversion to and from a string, and you may also want to
InstanceDescriptor to support more complex
initialization scenarios in design-time serialization.
If your object is immutable and requires recreation to modify it, you
need to override
GetCreateInstanceSupported(). This will be passed
System.Collections.IDictionary of property
name/value pairs and optionally an
ITypeDescriptorContext, which you may need to use
in the conversion process.
If the type contains properties or you wish to extend it to appear to
support properties of its own, you can override the
GetProperties() and ...