SCSF: Save and Load Layout of application

200 views Asked by At

i am using SCSF framework and SCSF contrib to add docking support in my application.

i want to save the layout of opened views so that i can restore them on application start.

how can i do this

1

There are 1 answers

0
Marcel On

We us SandDock as our docking layout engine. That has a simple method to get the layout, which we use to persist to XML.

        using (StreamWriter sw = new StreamWriter(fs))
        {
            string layout = _sandDockManager.GetLayout();
            sw.Write(layout);
        }

Then, later, we can retrieve back the layout from the deserialized XML file and apply it. Error checking code is removed for clarity:

        this._sandDockManager.SetLayout(sanddockXmlLayout);