Serialization Question

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

Hi,

In my app I have 4 classes with properties that needs to be saved to one
file (I would like it to be a xml file). How can I design my app to use the
..Net serialization which would allow each class to have its data saved to
one xml file?

Thanks
 
By 4 Classes I take it to mean one instance each of four distinct class
types? Or are their multiple instances of each class?

I presume you mean the former, in which case the easiest way I think would
be to create a fifth class that had four public members, one for each of the
four objects you need serialized. Then just serialize and deserialize an
object of this fifth class.

--Ken
 
You could create another class that contains a reference to objects of each
of your other four classes and then serialize that. That should create 1 xml
file containing all the data.
 
Back
Top