Back to Devexpress

BarManager.RestoreFromStream(Stream) Method

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

latest3.1 KB
Original Source

BarManager.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 bars’ layout from a stream.

Namespace : DevExpress.XtraBars

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 from which the bars’ layout is restored.

|

Remarks

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

Example

The following code demonstrates how to write and read a BarManager’s state to/from memory using the System.IO.MemoryStream class.

csharp
System.IO.Stream stream = new System.IO.MemoryStream();
    barManager1.SaveLayoutToStream(stream);
    //set the stream position to the beginning
    stream.Seek(0, System.IO.SeekOrigin.Begin);

    //...

    barManager1.RestoreLayoutFromStream(stream);
    //set the stream position to the beginning
    stream.Seek(0, System.IO.SeekOrigin.Begin);
vb
Dim stream As System.IO.Stream
    stream = New System.IO.MemoryStream()
    BarManager1.SaveLayoutToStream(stream)
    'set the stream position to the beginning
    stream.Seek(0, System.IO.SeekOrigin.Begin)

    '...

    BarManager1.RestoreLayoutFromStream(stream)
    'set the stream position to the beginning
    stream.Seek(0, System.IO.SeekOrigin.Begin)

See Also

SaveToStream(Stream)

Saving and Restoring a Bars Layout Manually

Saving and Restoring a Bars Layout Automatically

BarManager Class

BarManager Members

DevExpress.XtraBars Namespace