Serialization of an object

F

fperfect13

The problem is like this:

I have a class C1 which has a private field "private Graph graph;"
accesed by a property(C1.Graph). The class Graph is serializable but
when i pass to a method that serializes a Graph object C1.Graph it
gives an error saying that C1 isn't serializable. The project the
contains the C1 class has a reference to the project with Graph
class.(the proj with Graph class has no references to C1's class proj).
The serialization is binary to memstream and back (to make a deep
copy). Why would the compiler want to serialize the C1 class?
 
B

Bob Powell [MVP]

Does the graph contain a "Parent" reference to the C1 class? I expect this
is the case. These sorts of common reference serialization problems can
sometimes be overcome using the memento pattern.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
F

fperfect13

Thanks,
It was actualy a MulticastDelegate of an object inside Graph class to
C1 class.
 

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

Top