Esempio n. 1
0
        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 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
        }