Skip to main content

iCalendarEventImportException.Events Property

Provides access to an event collection containing events which raised an exception.

Namespace: DevExpress.XtraScheduler.iCalendar

Assembly: DevExpress.XtraScheduler.v24.2.Core.Desktop.dll

NuGet Package: DevExpress.Scheduler.CoreDesktop

#Declaration

public VEventCollection Events { get; }

#Property Value

Type Description
DevExpress.XtraScheduler.iCalendar.Components.VEventCollection

A DevExpress.XtraScheduler.iCalendar.Components.VEventCollection object representing a collection of calendar event components.

#Remarks

Use the Events property to indicate events which caused an exception in data exchange operations. The following try…catch code snippet illustrates how you can accomplish this:

try {
    using(Stream stream = dialog.OpenFile())
        ImportAppointments(stream);
}
catch(iCalendarEventImportException ex) {
    VEventCollection events = ex.Events;
    int count = events.Count;
    string message = String.Empty;
    for(int i = 0; i < count; i++) {
        VEvent ev = ex.Events[i];
        message += String.Format("Cannot import event '{0}' started on {1:D} at {2}\n",
         ev.Summary.Value, ev.Start.Value.Date, ev.Start.Value.TimeOfDay);
    }
    XtraMessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
See Also