Back to Devexpress

SchedulerStorageBase.ExportToVCalendar(Stream) Method

corelibraries-devexpress-dot-xtrascheduler-dot-schedulerstoragebase-dot-exporttovcalendar-x28-system-dot-io-dot-stream-x29.md

latest3.6 KB
Original Source

SchedulerStorageBase.ExportToVCalendar(Stream) Method

Exports the data in the scheduler to a stream in the vCalendar format.

Namespace : DevExpress.XtraScheduler

Assembly : DevExpress.XtraScheduler.v25.2.Core.Desktop.dll

NuGet Package : DevExpress.Scheduler.CoreDesktop

Declaration

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

Parameters

NameTypeDescription
streamStream

A Stream object which specifies the stream into which the scheduler’s data will be exported.

|

Remarks

When exporting data from the storage to vCalendar format, make sure that the DevExpress.XtraScheduler.vX.Y.VCalendarExchange.dll assembly is included in the References list of your project.

Note

The vCalendar data exchange is based on specification 1.0.

Example

The following example demonstrates how to export data from a SchedulerDataStorage to the vCalendar format. To do this you should use two overloads of the SchedulerDataStorage.ExportToVCalendar method. Note that these methods allow both exporting data either to a file, or to a stream.

csharp
using System.IO;
using DevExpress.XtraScheduler;
// ...

// Save appointments to a file in the vCalendar format.
private string StoreToVCalendarFile(SchedulerDataStorage storage){
    string path = "C:\\Temp\\Appointments.vcs";
    storage.ExportToVCalendar(path);
    return path;
}

// Save appointments to a stream in the vCalendar format.
private MemoryStream StoreToVCalendarStream(SchedulerDataStorage storage){
    MemoryStream stream = new MemoryStream();
    storage.ExportToVCalendar(stream);
    return stream;
}

// ...
vb
Imports System.IO
Imports DevExpress.XtraScheduler
' ...

' Save appointments to a file in the vCalendar format.
Private Function StoreToVCalendarFile(Storage As SchedulerDataStorage) As String
    Dim Path As String = "C:\Temp\Appointments.vcs"
    Storage.ExportToVCalendar(Path)
    Return Path
End Function

' Save appointments to a stream in the vCalendar format.
Private Function StoreToVCalendarStream(Storage As SchedulerDataStorage) As MemoryStream
    Dim Stream As New MemoryStream()
    Storage.ExportToVCalendar(Stream)
    Return Stream
End Function

' ...

Implements

ExportToVCalendar(Stream)

See Also

ImportFromVCalendar

ExportToVCalendar

SchedulerStorageBase Class

SchedulerStorageBase Members

DevExpress.XtraScheduler Namespace