Maybe you can get some ideas here
9/21/2005
XmlSerializatio n with IDictionary and CollectionBase Objects
http://sholliday.spaces.live.com/?_c...26ayear%3d2005
But for
#1
I'd write a "wrapper" object to handle this. Like, if you needed to
serialize a Plant object, Person object, Animal object......... you could
create a
ThingWrapper class, with 3 properties (1 for a Plant, 1 for a Person, 1 for
an Animal), and serialize the ThingWrapper.
OR
You can do each thing individually, and roll your own "xml merger", but
you'd have to do alot of work here. And when you needed to pull them out,
you'd have to use SelectNodes or SelectSingleNod e, and get the innerXml to
serialize each object. This is why I mention the ThingWrapper above.
#2 related to #1.
Check out my blog code...........
But the ThingWrapper is where I'd look to. That, or using the blog code to
figure out how to serialize collections of objects.
"SteveT" <St****@newsgro ups.nospamwrote in message
news:62******** *************** ***********@mic rosoft.com...
I want to be able to deserialize data contained within a XML file to a
data
structure. This I know how to do. However, what I want to be able to do
is
the following:
1. Serialize multiple "C# classes" into a single XML file. One at a time.
2. Deserialize each "C# class" from the XML file. One at a time.
Is this possible? I don't see a way to do this. If it isn't possible
does
anyone have a suggestion on how to get around a problem I have. I have
many
data structures that I need to save to disk and later retrieve when a
program
runs. The data structures are contained in nodes of a TreeView list. If
I
serialize each structure one-by-one I may have hundreds of XML files. I
want
to group certain TreeView node-paths all under a single XML file to have
fewer XML files to manage and thus make things easier. How could I go
about
doing this?
--
-----------
Thanks,
Steve