N
news.austin.rr.com
Hi,
Im thinking of using/overriding ToString in my classes to allow me to
display an objects value as a human readable formated string. Using ToString
for this will come in handy with my custom list control. Instead of adding
strings to my list controls arraylist I can add the actuall object then use
the objects overriden ToString method to have the object return the objects
data in the format I wish to display it in by using the objects ToString
override. i.e. (return this.Column1[this.SelectedIndex].ToString() This
allows me to return the string if the object in the arraylist is a string or
I can return the string from the objects ToString override if the object in
the arraylist is a different type of object.
My question is.... Should I reserve the ToString overrides for serialization
uses. Since the CF doesn't support XML serialization of objects I plan to
write my own code to read and write objects to a file. I could just create
another method like (ToXmlString) for serialization for the objects i plan
to serialize.
So...
Does this sound solid or should I reserve the ToString overrides for
serialization uses?
Im thinking of using/overriding ToString in my classes to allow me to
display an objects value as a human readable formated string. Using ToString
for this will come in handy with my custom list control. Instead of adding
strings to my list controls arraylist I can add the actuall object then use
the objects overriden ToString method to have the object return the objects
data in the format I wish to display it in by using the objects ToString
override. i.e. (return this.Column1[this.SelectedIndex].ToString() This
allows me to return the string if the object in the arraylist is a string or
I can return the string from the objects ToString override if the object in
the arraylist is a different type of object.
My question is.... Should I reserve the ToString overrides for serialization
uses. Since the CF doesn't support XML serialization of objects I plan to
write my own code to read and write objects to a file. I could just create
another method like (ToXmlString) for serialization for the objects i plan
to serialize.
So...
Does this sound solid or should I reserve the ToString overrides for
serialization uses?