
Signature
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
Thanks for that, but a number of the existing classes are from the framework,
and I do not want to go through all the code (1000000+) and start renaming
all the classes so that I can add the Ixmlserializable interface to all of
them.
> > I have some XML data which I wish to relate to existing classes, but data
> > does not map exactly so serialsation will not work, the other
[quoted text clipped - 19 lines]
> See
> http://msdn.microsoft.com/en-us/library/system.xml.serialization.ixmlserializabl
e.aspx.
Joris van Lier - 26 May 2008 10:58 GMT
> Thanks for that, but a number of the existing classes are from the
> framework,
> and I do not want to go through all the code (1000000+) and start renaming
> all the classes so that I can add the Ixmlserializable interface to all of
> them.
You can use the ISerializationSurrogate interface to delegate the
serialization to another class,
see my post titled "Mapping between schemata while serializing" in this
newsgroup.
How to serialize an object which is not marked as 'Serializable' using a
surrogate.
http://www.codeproject.com/KB/dotnet/Surrogate_Serialization.aspx
Joris