Skip to main content

AppointmentCancelEventArgs Class

Serves as the base class for classes which provide data for certain appointment events with the ability to cancel the operation being performed.

Namespace: DevExpress.XtraScheduler

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

#Declaration

public class AppointmentCancelEventArgs :
    AppointmentEventArgs

#Remarks

The AppointmentCancelEventArgs class introduces the AppointmentCancelEventArgs.Cancel property which specifies whether the operation performed on the processed event should be cancelled.

Note that AppointmentCancelEventArgs objects are automatically created, initialized and passed to the corresponding event handlers.

#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;
    }
}
See Also