LayoutControl.RestoreLayoutFromStream(Stream) Method

Restores the layout from the specified stream.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.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 layout is read. If null (Nothing in Visual Basic), an exception is raised.

Remarks

Use the RestoreLayoutFromStream method to load the layout from the stream to which it was saved via the LayoutControl.SaveLayoutToStream method.

See Save and Restore Layout to learn more.

Examples

The following sample code saves the current layout to a memory stream and then restores it.

System.IO.Stream stream;
stream = new System.IO.MemoryStream();
layoutControl1.SaveLayoutToStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

// ...
layoutControl1.RestoreLayoutFromStream(stream);
stream.Seek(0, System.IO.SeekOrigin.Begin);

Implements

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