We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

AppStateSerializer

I have an MDI app with two DockingManagers. How can I persist both DockingManagers states then retrieve them? I''d like to use an AppStateSerializer. I''m using VS 2005, Syncfusion 4.1beta with the 2.0 dll''s and C#.

2 Replies

VS Vijayanand S Syncfusion Team January 2, 2006 06:21 AM UTC

Hi Narendra, You could save/load the dock state using the AppStateSerializer as in the following code snippet: //Serializing AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFile, Application.StartupPath + System.IO.Path.DirectorySeparatorChar + fileName); this.dockingManager1.SaveDockState(aser); aser.PersistNow(); //De-Serializing. Make sure it doesnt go into an infinite loop when used in NewDockStateEndLoad event handler. AppStateSerializer aser = new AppStateSerializer(SerializeMode.XMLFile, Application.StartupPath + System.IO.Path.DirectorySeparatorChar + fileName); this.dockingManager1.LoadDockState(aser); You could refer to our Docking Package samples: UserControlContainer or MDIContainerControl Demo at the following location "[InstalledDerive]:\Program Files\Syncfusion\Essential Studio\4.1.0.10\windows\Tools.Windows\Samples\Docking Package\ContainerControlSupportDemo\" to save or restore the multiple docking managers state information. However I have created a test sample to show the procedure to save or load the information about the docking state.Please take a look at the attached sample and let me know if you have any questions. Thank you for your interest in Syncfusion products. Regards, Vijay Test Sample


NM Narendra Maharaj January 5, 2006 11:47 PM UTC

Thanks Vijay I was doing a appStateSerializer.PersistNow() twice. It works now.

Loader.
Live Chat Icon For mobile
Up arrow icon