Back to Devexpress

LayoutControl.RestoreLayoutFromStream(Stream) Method

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-restorelayoutfromstream-x28-system-dot-io-dot-stream-x29.md

latest3.2 KB
Original Source

LayoutControl.RestoreLayoutFromStream(Stream) Method

SECURITY-RELATED CONSIDERATIONS

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the layout from the specified stream.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Parameters

NameTypeDescription
streamStream

A Stream descendant from which the layout is read. If null ( Nothing in Visual Basic), an exception is raised.

|

Remarks

The LayoutControl.SaveLayoutToStream method saves the Layout Control’s layout to a stream. You can then restore this layout using the RestoreLayoutFromStream method.

See Save and Restore Layout to learn more.

Example

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

csharp
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);
vb
Dim stream As System.IO.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)

See Also

RestoreLayoutFromRegistry(String)

RestoreLayoutFromXml(String)

OptionsSerialization

Save and Restore Layouts of DevExpress controls

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace