Back to Devexpress

BaseAppearanceCollection.RestoreLayoutFromStream(Stream) Method

windowsforms-devexpress-dot-utils-dot-baseappearancecollection-dot-restorelayoutfromstream-x28-system-dot-io-dot-stream-x29.md

latest3.3 KB
Original Source

BaseAppearanceCollection.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 appearance settings from the specified stream.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

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 appearance settings are read.

|

Remarks

Use the RestoreLayoutFromStream method to load the appearance settings from a stream to which these settings were saved via the BaseAppearanceCollection.SaveLayoutToStream method. If the specified stream is empty or null ( Nothing in Visual Basic), an exception is raised.

Example

The following sample code saves the appearance settings used to paint the XtraGrid’s elements to a memory stream and then restores them.

csharp
System.IO.Stream str;
str = new System.IO.MemoryStream();
gridControl1.MainView.Appearance.SaveLayoutToStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);

// ...

gridControl1.MainView.Appearance.RestoreLayoutFromStream(str);
str.Seek(0, System.IO.SeekOrigin.Begin);
vb
Dim str As System.IO.Stream
str = New System.IO.MemoryStream()
GridControl1.MainView.Appearance.SaveLayoutToStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)

' ...

GridControl1.MainView.Appearance.RestoreLayoutFromStream(str)
str.Seek(0, System.IO.SeekOrigin.Begin)

See Also

SaveLayoutToStream(Stream)

RestoreLayoutFromRegistry(String)

RestoreLayoutFromXml(String)

Save and Restore Layouts of DevExpress controls

BaseAppearanceCollection Class

BaseAppearanceCollection Members

DevExpress.Utils Namespace