Skip to main content

AppointmentExporter.Export(Stream) Method

Exports appointments to the specified stream.

Namespace: DevExpress.XtraScheduler.Exchange

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

NuGet Package: DevExpress.Scheduler.Core

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

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Export(Stream) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also