Ron,
If you build a new class, should the ToString method always be declared
overridden from object in a method (what is not always the fact and than you
get back only object information)
If it is overloaded can be dependable from the class, when it is overloaded
that can be done with everything. In the String class one of those has the
IFormatProvider, but how it works is completely dependend from how the
builder of the class has used the overriding and possible the overloading.
In normal OOP programming there should in my opinion be no reason to use
late binding, therefore no reason to find out what members an object has and
how they are implemented with reflection.
Cor
"Ron M. Newman" <co**********@confideltial.comschreef in bericht
news:ue**************@TK2MSFTNGP05.phx.gbl...
Dear C# Sages,
For my own persistence purposes I need to be able to load an object from
some source and re-fit it with its value that's represented as a string.
Many objects support "Parse" which takes a string input and sets the value
for the object. However, I can't find a way to "pre-identify" those
objects with the same ease I can do the opposite: ask an object if it's
IFormattable so that I can invoke its "ToString" method. Am I doomed to
use reflection to actually ask each object i come across if it has a
"Parse" method that has a string as paramter? Isn't there some
"uber-Interface" this adheres to?
am I missing something?
Thanks
- Ron