Serialization of an object

  • Thread starter Thread starter fperfect13
  • Start date Start date
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?
 
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.
 
Thanks,
It was actualy a MulticastDelegate of an object inside Graph class to
C1 class.
 
Back
Top