AppointmentImporter.AppointmentImporting Event
Occurs before an AppointmentImporter class descendant imports an appointment from an iCalendar file.
Namespace: DevExpress.XtraScheduler.Exchange
Assembly: DevExpress.XtraScheduler.v14.2.Core.dll
#Declaration
#Event Data
The AppointmentImporting event's handler receives an argument of the AppointmentImportingEventArgs 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 AppointmentImporting event when implementing custom appointment import procedures. It enables you to decide what to do if conflicting items are found, and select which appointments should be imported.
To know more about iCalendar support, refer to the corresponding iCalendar Support article.
#Examples
This example demonstrates how to import only non-recurring appointments to the scheduler control from the iCalendar format. To perform such custom import operations, handle the AppointmentImporter.AppointmentImporting event and use the AppointmentCancelEventArgs.Cancel property.
using System.IO;
using DevExpress.XtraScheduler;
using DevExpress.XtraScheduler.iCalendar;
// ...
private void ImportAppointments(Stream stream) {
if (stream == null || Stream.Null.Equals(stream))
return;
iCalendarImporter importer = new iCalendarImporter(schedulerControl1.GetCoreStorage());
importer.AppointmentImporting += new AppointmentImportingEventHandler(importer_AppointmentImporting);
importer.Import(stream);
}
void importer_AppointmentImporting(object sender, AppointmentImportingEventArgs e) {
if (e.Appointment.IsRecurring) {
e.Cancel = true;
}
}