I am deserializing an xml file to an object and wanted to know how
strings are converted to their proper types.
For example consider this fragment of xml:
<FileLoader MaxFileSize="30000" />
I have a class called FileLoader with a property called MaxFileSize
defined as a Long. When the xml is deserialized, how is the string
value in the xml file converted to a Long? Does it use CLng? Does it
use Convert.ToInt64?
I want to be able to control the conversion to some extent in that if
the xml contained something like this:
<FileLoader MaxFileSize="30M" />
That the value would be deserialized to a Long with a value of 30000000
Or if I specify
<FileLoader MaxFileSize="30K" />
That the value would be deserialized to a Long with a value of 30000
In other words, the xml may not just contain a number. It might be a
number with an M or K on it to indicate the units.
Can the deserialization be controlled in this manner?
Thanks