TypeConverter for serialization

Posted by Cat on Stack Overflow See other posts from Stack Overflow or by Cat
Published on 2010-06-11T22:10:56Z Indexed on 2010/06/11 22:12 UTC
Read the original article Hit count: 519

Filed under:
|
|

Is it normal practice to use a TypeConverter for serialization? There is a class that I do not own that has a "lossy" TypeConverter. When converting to a string, it formats its floating point data with "G4", so that when this type is displayed in a PropertyGrid, it's easily readable.

I would like to also use this TypeConverter to convert from a string, creating an instance of this class. Right now I am checking the CultureInfo passed to TypeConverter.ConvertTo and only using the pretty, lossy conversion if the CultureInfo is not InvariantCulture.

I'd like to know if I'm going about this the wrong way.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about serialization