Back to Devexpress

DockManager.RestoreFromStream(Stream) Method

windowsforms-devexpress-dot-xtrabars-dot-docking-dot-dockmanager-dot-restorefromstream-x28-system-dot-io-dot-stream-x29.md

latest3.2 KB
Original Source

DockManager.RestoreFromStream(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 in the specified stream to the dock panels.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void RestoreFromStream(
    Stream stream
)
vb
<EditorBrowsable(EditorBrowsableState.Never)>
Public Overridable Sub RestoreFromStream(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

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

|

Remarks

This method is obsolete. Use the DockManager.RestoreLayoutFromStream method instead.

Example

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

csharp
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);
vb
Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
DockManager1.SaveToStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)

' ...

DockManager1.RestoreFromStream(stream)
' Set the stream pointer to the beginning.
stream.Seek(0, System.IO.SeekOrigin.Begin)

See Also

RestoreFromRegistry(String)

RestoreFromXml(String)

SaveToStream(Stream)

Saving and Restoring the Layout of Dock Panels

DockManager Class

DockManager Members

DevExpress.XtraBars.Docking Namespace