How to Serialize 2 GoDocument in the same file doc

HI,

I have 2 goview panel, goView1 and goView2. I create FormDocument Class with GoDocument.

My aim is to save object in goview panel.

I have success save the goView1 and goView2 separately using binary Serializable like example provided by ur company.

here is some of the code:

FormDocument doc = null;
if (this.goView1.Focus())
doc = goView1.Document as FormDocument;
else if(this.goView2.Focus())
doc = goView2.Document as FormDocument;

if (doc != null)
{
doc.Store(file);
}

The problem is how can i save both goView by using only 1 file and yet it will load back as early time
Is there any way to combine both doc

Fauzi

Hey… i manage to solve my problem…

just add the document into arraylist then serilize the arraylist

Thank you.

I hope you aren’t doing binary serialization of documents for long-term persistence. You might run into problems when you upgrade your application, or when you upgrade your versions of GoDiagram or of .NET.

Yeah, like, for example… you do this really cool planogram tool for a nationally known hardware company, and you store the files using MFC binary serialization. Then, years later, they come back for a new version written for .NET, but the first requirement is that they be able to use existing planogram files. sigh… so your first task in the new project is to write a translator to XML.

For the record: Walter warned us back then not to use serialization.

Yes both of you was right about binary serialization. So what is another solution to use beside binary serialization?

XML. See the XML section in the User Guide. All of the samples that support save/restore use XML.