Hello experts,
I'm a total C# noob with a total C# noob question.
I've been Serializing in C++ (MFC) and writing data to std::fstreams for
quite some time, so maybe I'm not understanding this different
technique, or reading too much into it, or not enough: but, I'm not
quite wrapping my brain around serialization in C#.
Here's what I have and here's what I want to do:
I have a [Serializable] abstract class, "Bead". Derived from Bead is a
family of Bead-Types - RedBead, BlueBead, GreenBead, OrangeBead,
ClearBead, etc - all of which are [Serializable].
Over here, I have a TreeView object. Each TreeNode of the TreeView
object has a Bead object assigned to it, via the Tag property.
I want to save the Bead hierarchy as it appears in the tree.
Now, if I were to Serialize the TreeView itself, would it properly save
each attached Bead when it does so? Do I have to make each Bead type
serializable, and define serialize/deserialize methods for them?
I dont mind traversing the tree and having each bead serialize and
deserialize itself, (which was what I was going to do), but I'm
wondering if this "Save the whole darned Tree" approach would work.
Any thoughts?
TIA.
--
Bryan