Back to Devexpress

SchedulerControl.RestoreLayoutFromStream(Stream) Method

windowsforms-devexpress-dot-xtrascheduler-dot-schedulercontrol-dot-restorelayoutfromstream-x28-system-dot-io-dot-stream-x29.md

latest2.9 KB
Original Source

SchedulerControl.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 control’s layout from the specified stream.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.dll

NuGet Package : DevExpress.Win.Scheduler

Declaration

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

Parameters

NameTypeDescription
streamStream

A Stream descendant from which settings are read.

|

Remarks

Use the RestoreLayoutFromStream method to load the control’s layout from the stream to which the layout was saved via the SchedulerControl.SaveLayoutToStream method. If the specified stream is empty or null (Nothing in Visual Basic), an exception is raised.

Example

The following example demonstrates how to save a scheduler’s layout to a memory stream and then restore it.

csharp
using System.IO;
// ...

Stream stream = new MemoryStream();
// ...

// Save the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin);
schedulerControl1.SaveLayoutToStream(stream);

// Load the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin);
schedulerControl1.RestoreLayoutFromStream(stream);
vb
Imports System.IO
' ...

Dim stream As System.IO.Stream
stream = New System.IO.MemoryStream()
' ...

' Save the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin)
SchedulerControl1.SaveLayoutToStream(stream)

' Load the scheduler's layout.
stream.Seek(0, System.IO.SeekOrigin.Begin)
SchedulerControl1.RestoreLayoutFromStream(stream)

See Also

Save and Restore Layouts of DevExpress controls

SchedulerControl Class

SchedulerControl Members

DevExpress.XtraScheduler Namespace