Is it possible to use custom type converter to convert types like that:
class MyTypeConverter: TypeConverter
{
//... all the 'converting' methods here
}
[TypeConverter(typeof(MyTypeConverter))]
class Type1 {}
class Type2 {}
Type2 object2;
//and here, is this possible? (and how to make it happen)
Type1 object1 = object2;
//or at least how to make this work:
Type1 object1 = (Type1)object2;
Compiler complains that it cannot convert Type1 to Type2 either way.
I can of course instantiate the converter manually and then use it's ConvertFrom method, but am I actually supposed to do that?
Please help...