Serializing a class hierarchy 
Author Message
 Serializing a class hierarchy

Is there a way of automatically writing the contents of many instanicated
classes in memory,  to XML?
Some of the classes have pointers to and arrays of pointers to other
classes, and I need these in XML, also.
Writing code for this by hand takes to much time.
It seems like the XmlSerializer in System.Xml.Serialization can only
serialize public data. And NO object graphs.

I'm using C#, by the way.

Odd Magne H?gensen



Sun, 22 May 2005 18:56:08 GMT  
 Serializing a class hierarchy
Odd,

    You are right, the XML serializer only serializes public properties.
You will have to use either the BinaryFormatter class or the SoapFormatter
class if you want to serialize the complete object graph.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]



Quote:
> Is there a way of automatically writing the contents of many instanicated
> classes in memory,  to XML?
> Some of the classes have pointers to and arrays of pointers to other
> classes, and I need these in XML, also.
> Writing code for this by hand takes to much time.
> It seems like the XmlSerializer in System.Xml.Serialization can only
> serialize public data. And NO object graphs.

> I'm using C#, by the way.

> Odd Magne H?gensen



Sun, 22 May 2005 21:16:47 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. class hierarchy for classes with only static methods

2. Object Browser: Inheritance Class Hierarchy???

3. Exporting class derived from std::exception hierarchy

4. custom exceptions and placement in class hierarchy

5. Raising events way up in the class hierarchy

6. templates and class hierarchy window

7. Class Hierarchy Chart???

8. Class Hierarchy View?

9. Slightly OT - Class Hierarchy

10. class hierarchy viewer

11. visualize class-hierarchies from a foreign projekt

12. Q: serialization when class hierarchy changes

 

 
Powered by phpBB® Forum Software