Serialization of object tree

D

Dim

Hi!

Kinda newbie to .NET nad got following question:
Serializing objects in C#:

I have a complex object that contains lots of data and other object
including GraphicsPath, Point, Rectangle etc.. mostly
from System.Drawing, System.Windows.Forms.

When my object is constructed completelly and all graphics have been created
(btw my object inherits Panel class)
i want to be able to serialize whole bunch starting with my object and down
to the last variable in objects within that i have set.

I tried to serialize it simply by passing it to IFormatter and adding an
open file stream, but i get an exception telling
me that Panel class is not marked as Serializable. Ok i accepted this and
remade object so that only objects within should serialize. But not
enought... even GraphicsPath is apparently not serializable.
So i can't serialize nothing but simple classes with just some variables????
How can i serialize the whole tree.. cause its a big tree and saving only
primitives and reconstructing it later is way too much work.

Thanx!!!
 

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