A newer version of this page is available. Switch to the current version.

AppointmentExporter.Export(Stream) Method

Exports appointments to the specified stream.

Namespace: DevExpress.XtraScheduler.Exchange

Assembly: DevExpress.XtraScheduler.v18.2.Core.dll

Declaration

public virtual void Export(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A Stream object which represents the stream the appointments will be exported to.

Remarks

This method should be overridden in descendants of the AppointmentExporter class.

To export appointments to a MS Outlook calendar, use the OutlookExport class obtained by using the SchedulerStorageBase.CreateOutlookExporter method. The OutlookExport class descends from the AppointmentExporter class and overrides its Export method, so that the stream parameter is ignored. You can set it to any value or to the Null, as illustrated in the following code snippet:


using DevExpress.XtraScheduler.Exchange;
using DevExpress.XtraScheduler.Outlook;
//...
// Create an exporter class instance.
AppointmentExporter exporter = schedulerStorage.CreateOutlookExporter();
// Specify a path to the calendar folder.
((ISupportCalendarFolders)importer).CalendarFolderName = "\\\\Personal Folders\\MyCalendar";
// Prepare a progress bar or perform other actions prior to import.
BeforeExport(exporter.SourceObjectCount);
// Perform the export.
// The Outlook exporter ignores the stream parameter of the Export method, 
// so it can be set to any object of the Stream type
// or to the System.IO.Stream.Null.
try
    {
        exporter.Export(System.IO.Stream.Null);
    }
finally
    {
        // Finalize the process.
        AfterExport();
    }
See Also