示例#1
0
 private void buttonCopy_Click(object sender, EventArgs e)
 {
     try
     {
         this.CopyExceptionToClipboard();
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex);
         ExceptionDialog.ShowDialog(this, ex);
     }
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
        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);
            }
        }
示例#4
0
 /// <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);
     }
 }
示例#5
0
        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);
            }
        }
示例#6
0
        /// <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);
            }
        }