windowsforms-devexpress-dot-xtrabars-dot-barmanager-dot-savetostream-x28-system-dot-io-dot-stream-x29.md
Saves the BarManager component’s state to a stream.
Namespace : DevExpress.XtraBars
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void SaveToStream(
Stream stream
)
<EditorBrowsable(EditorBrowsableState.Never)>
Public Overridable Sub SaveToStream(
stream As Stream
)
| Name | Type | Description |
|---|---|---|
| stream | Stream |
A stream to which the BarManager componen’st state is saved.
|
This method is obsolete. Use the BarManager.SaveLayoutToStream method instead.
The following code demonstrates how to write and read a BarManager’s state to/from memory using the System.IO.MemoryStream class.
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);
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
Saving and Restoring a Bars Layout Manually