14 using System.Collections.Generic;
15 using System.Windows.Forms;
16 using System.Diagnostics;
18 namespace Irony.GrammarExplorer {
25 Application.EnableVisualStyles();
26 Application.SetCompatibleTextRenderingDefault(
false);
27 Application.ThreadException +=
new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
28 AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
32 static void Application_ThreadException(
object sender, System.Threading.ThreadExceptionEventArgs e) {
33 fmShowException.ShowException(e.Exception);
34 Debug.Write(
"Exception!: ############################################## \n" + e.Exception.ToString());
37 static void CurrentDomain_UnhandledException(
object sender, UnhandledExceptionEventArgs e) {
39 string message = (ex == null ? e.ExceptionObject.ToString() : ex.Message);
41 Debug.Write(
"Exception!: ############################################## \n" + e.ExceptionObject.ToString());
42 MessageBox.Show(message,
"Exception");
44 fmShowException.ShowException(ex);