> > I have a Serializable Class that has a Double member.
> >
[quoted text clipped - 11 lines]
>
> Pete
> The issue is that I do need the number representation.
>
> And unfortunately , I have 100+ classes that I would need to implement an
> ISerializable on -
>
> you wouldnt happen to have a short example :)
MSDN does a fine job of documenting ISerializable, so I don't think I
need to provide an example of that. An example of dealing with a
hundred classes with one simple change, I don't think exists. I'm sure
not aware of a way to do that.
Of course, you could implement your own version of Double that
serializes the way you want, and then use that instead of the built-in
Double everywhere. You'd have to touch every class, but if you do it
right it should amount to little more than a global search-and-replace.
Another option: you could insert your own Stream in between the
serializing and the file output, looking for Doubles serialized as
scientific notation and expanding each one as you desire. You serialize
to your own stream rather than the destination stream, and your stream
would write the modified results to the destination stream.
Me, I'd rather try to change the requirements than hack serialization
that way. But that's not always possible, and I think you could
probably get what you wanted by doing that.
I'm assuming here that the serialized data is a text stream of some
sort, but since you're concerned about the string representation of the
serialized data, that seems like a safe assumption.
Pete