AppointmentExporter.AppointmentExporting Event
Occurs before an Appointment Exporter exports an appointment to an iCalendar file.
Namespace: DevExpress.XtraScheduler.Exchange
Assembly: DevExpress.XtraScheduler.v14.2.Core.dll
#Declaration
#Event Data
The AppointmentExporting event's handler receives an argument of the AppointmentExportingEventArgs type. The following properties provide information specific to this event:
Property | Description |
---|---|
Appointment |
Gets the appointment for which the event was raised.
Inherited from Appointment |
Cancel |
Gets or sets whether the operation performed on the processed event should be canceled.
Inherited from Appointment |
#Remarks
Handle the AppointmentExporting event for AppointmentExporter descendants when implementing custom appointment export. It enables you to decide what to do if conflicting items are found, and select which appointments should be exported.
For more on iCalendar support, refer to the corresponding iCalendar Support article.
#Examples
This example demonstrates how to export only appointments marked with the Birthday label to the iCalendar format from the scheduler. To perform such custom export operations, handle the AppointmentExporter.AppointmentExporting event and use the AppointmentCancelEventArgs.Cancel property.
using System.IO;
using DevExpress.XtraScheduler.iCalendar;
using DevExpress.XtraScheduler;
void ExportAppointments(Stream stream) {
if (stream == null || Stream.Null.Equals(stream))
return;
iCalendarExporter exporter = new iCalendarExporter(schedulerControl1.GetCoreStorage());
exporter.ProductIdentifier = "-//Developer Express Inc.//DXScheduler iCalendarExport Example//EN";
exporter.AppointmentExporting += new AppointmentExportingEventHandler(exporter_AppointmentExporting);
exporter.Export(stream);
}
void exporter_AppointmentExporting(object sender, AppointmentExportingEventArgs e) {
if (e.Appointment.LabelId != 8) {
e.Cancel = true;
}
}