GetObjectData

  • Thread starter Thread starter Martin. D. Waller
  • Start date Start date
M

Martin. D. Waller

Hello,

I wonder if anyone can help me. If I have two classes C1 and C2, C1 holds a
reference to C2 and also holds a reference to a class that is not understood
by the serializer.

Now, if I was to serialize C1 (and hence C2) I have to implement
GetObjectData which seems to want me to add name / value pairs for all the
class members I need. How do I then serialize C2 ? Do I have to do it myself
in GetObjectData or can I pass the serialization of C2 on ?

Many thanks...

Martin
 
you need not go through all of that.
it is possible to attribute the "not understood" class to be ignored (if you
are talking about XML serialization, the attribute is XmlIgnore).

Then you could use a memento pattern or something similar in C2 to store the
info necessary to serialize "the other class".
http://www.ondotnet.com/pub/a/dotnet/2002/09/09/memento.html


-Dino
Microsoft
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top