private void showError(ShapeImportExceptionEventArgs ex) { if (ex.IsTerminating) { MessageBox.Show(this, "Error: " + ((Exception)ex.ExceptionObject).Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { if (MessageBox.Show(this, string.Format("Error: {0}\n\n" + "Current shape:\nIndex: #{1}\n{2}" + "\nShape geometry has been written to log file." + "\nClick OK to ignore, Cancel to abort." , ((Exception)ex.ExceptionObject).Message , ex.ShapeIndex , ex.ShapeInfo) , "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Cancel) { _importer.CancelAsync(); } else { ex.Ignore = true; } } }
private void importer_Error(object sender, ShapeImportExceptionEventArgs e) { showErrorDelegate del = new showErrorDelegate(showError); this.Invoke(del, new object[] { e }); }