private void buttonCopy_Click(object sender, EventArgs e) { try { this.CopyExceptionToClipboard(); } catch (Exception ex) { Debug.WriteLine(ex); ExceptionDialog.ShowDialog(this, ex); } }
/// <summary> /// Occurs when the Ok button is clicked. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnButtonOkClick(object sender, EventArgs e) { try { this.DialogResult = DialogResult.OK; this.Close(); } catch (Exception ex) { Debug.WriteLine(ex); ExceptionDialog.ShowDialog(this, ex); } }
public static void ShowDialog(IWin32Window owner, Exception ex) { if (Form.ActiveForm != null) { ShowDialog(Form.ActiveForm, ex); return; } using (ExceptionDialog dialog = new ExceptionDialog(ex)) { dialog.ShowDialog(owner); } }
/// <summary> /// Show's the ExceptionDialog modally while displaying the details of the exception. /// </summary> /// <param name="ex"></param> public static void ShowDialog(Exception ex) { try { using (ExceptionDialog dialog = new ExceptionDialog(ex)) { dialog.ShowDialog(); } } catch (Exception exc) { Debug.WriteLine(exc); } }
void OnLinkLabelSendErrorReportClick(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this.SubmitUrl)) { return; } Process.Start(this.SubmitUrl); } catch (Exception ex) { Debug.WriteLine(ex); ExceptionDialog.ShowDialog(this, ex); } }
/// <summary> /// Show's the ExceptionDialog modally while displaying the details of the exception. /// </summary> /// <param name="owner"></param> /// <param name="ex"></param> public static void ShowDialog(Form owner, Exception ex) { if (owner == null || owner.IsDisposed) { ShowDialog(ex); return; } if (owner.InvokeRequired) { owner.Invoke(new ShowDialogDelegate(ShowDialog), owner, ex); return; } using (ExceptionDialog dialog = new ExceptionDialog(ex)) { dialog.ShowDialog(owner); } }