DockManager.RestoreLayoutFromStream(Stream) Method

Restores the layout of dock panels from the specified stream.

Namespace: DevExpress.XtraBars.Docking

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

public virtual void RestoreLayoutFromStream(
    Stream stream
)
Public Overridable Sub RestoreLayoutFromStream(
    stream As Stream
)

Parameters

Name Type Description
stream Stream

A Stream descendant from which the dock panels' settings are read. If null (Nothing in Visual Basic), an exception is raised.

Remarks

NOTE

When restoring a layout during a form load (for instance, in your Form.Load event handler), you may need to call the DockManager.ForceInitialize method prior to the layout restoration. See this method to learn more.

For more information, see Saving and Restoring the Layout of Dock Panels

Examples

The following code demonstrates how to write and read the docking layout to and from memory.

System.IO.Stream stream = new System.IO.MemoryStream();
dockManager1.SaveLayoutToStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...

dockManager1.RestoreLayoutFromStream(stream);
// Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin);

Implements

DevExpress.Utils.Serializing.ISupportXtraSerializer.RestoreLayoutFromStream(Stream)
See Also