K
Kenneth Baltrinic
I am implementing a class that routinely needs to be cast to and from a
string. I would love for some way to make the compiler realize that my
class can be cast to and from a string. Implementing a TypeConverter seems
like it is designed to do this kind of thing but it doesn't actually do it,
apparently. I have implemented a type convert for my class, applied the
[TypeConverter...] attribute to my class but any attempt to do
(string)VarOfMyClass or (MyClass)StringVar won't compile.
Is this something that just can't be done?
--Ken
string. I would love for some way to make the compiler realize that my
class can be cast to and from a string. Implementing a TypeConverter seems
like it is designed to do this kind of thing but it doesn't actually do it,
apparently. I have implemented a type convert for my class, applied the
[TypeConverter...] attribute to my class but any attempt to do
(string)VarOfMyClass or (MyClass)StringVar won't compile.
Is this something that just can't be done?
--Ken