void exporter_OnException(object sender, ExchangeExceptionEventArgs e) { string errText = e.OriginalException.Message; AddToLog(errText); OutlookExport exporter = (OutlookExport)sender; exporter.Terminate(); e.Handled = true; //throw e.OriginalException; }
void importer_OnException(object sender, ExchangeExceptionEventArgs e) { iCalendarParseExceptionEventArgs args = e as iCalendarParseExceptionEventArgs; if (args != null) { DXMessageBox.Show(String.Format("Can't parse line '{1}' at {0} index", args.LineIndex, args.LineText)); iCalendarImporter importer = (iCalendarImporter)sender; importer.Terminate(); } e.Handled = true; }
void synchronizer_OnException(object sender, ExchangeExceptionEventArgs e) { string errText = e.OriginalException.Message; OutlookExchangeExceptionEventArgs args = e as OutlookExchangeExceptionEventArgs; if (args != null) { if (args.OutlookAppointment != null) { errText += String.Format("\r\nEvent '{0}' started on {1:D} at {2}\n", args.OutlookAppointment.Subject, args.OutlookAppointment.Start, args.OutlookAppointment.Start.TimeOfDay); } } AppointmentImportSynchronizer synchronizer = (AppointmentImportSynchronizer)sender; synchronizer.Terminate(); e.Handled = true; throw e.OriginalException; }
void importer_OnException(object sender, ExchangeExceptionEventArgs e) { iCalendarParseExceptionEventArgs args = e as iCalendarParseExceptionEventArgs; if (args != null) { if (ckhBreakOnError.Checked) { iCalendarImporter importer = (iCalendarImporter)sender; importer.Terminate(); } ShowErrorMessage(String.Format("Cannot parse line {0} with text '{1}'", args.LineIndex, args.LineText)); } else { ShowErrorMessage(e.OriginalException.Message); } e.Handled = true; // prevent this exception from throwing }