2 using System.Drawing;
\r
3 using System.Windows.Forms;
\r
5 namespace AppliStation.Util
\r
8 /// Description of ExceptionDialogForm.
\r
10 public partial class ExceptionDialogForm : Form
\r
12 public ExceptionDialogForm()
\r
15 // The InitializeComponent() call is required for Windows Forms designer support.
\r
17 InitializeComponent();
\r
20 private static void Application_ThrowException(Exception e)
\r
22 ExceptionDialogForm form = new ExceptionDialogForm();
\r
24 form.detailTextBox.Text = e.ToString() + System.Environment.NewLine + e.StackTrace;
\r
26 form.viewDetailButton.Visible = false;
\r
29 switch (form.ShowDialog()) {
\r
30 case DialogResult.Cancel:
\r
38 public static void Application_ThrowException(object sender, System.Threading.ThreadExceptionEventArgs e)
\r
40 Application_ThrowException(e.Exception);
\r
43 public static void Application_ThrowException(object sender, UnhandledExceptionEventArgs e)
\r
45 Application_ThrowException((Exception) e.ExceptionObject);
\r
48 void ViewDetailLabelLinkClicked(object sender, EventArgs e)
\r
50 this.detailTextBox.Visible = true;
\r
51 this.viewDetailButton.Enabled = false;
\r
52 this.Size = new Size(this.Size.Width, this.Size.Height + 250);
\r
55 void Form_Shown(object sender, EventArgs e)
\r
57 this.quitButton.Focus();
\r