Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Export Data to vCalendar

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.

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;
}

// ...