Parent Directory
|
Revision Log
|
Patch
--- trunk/TSControlPanel/Program.cs 2012/07/12 16:44:24 56 +++ trunk/TSControlPanel/Program.cs 2012/07/12 16:47:17 57 @@ -12,8 +12,7 @@ /// </summary> [STAThread] static void Main() - { - AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); + { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); @@ -21,29 +20,5 @@ objCustomDialogBox.dialogMode = frmClientProperties.ATSClientMode.CONTROL_PANEL; // Select the mode to run the form in. Application.Run(objCustomDialogBox); } - static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - Exception ex = (e.ExceptionObject as Exception); - if (ex == null) - { - Logging.TSControlPanelLog.Error("Encountered unhandled Exception, but the exception was null"); - return; - } - if (ex.GetType() == typeof(SqlException)) - { - SqlException sql_ex = (ex as SqlException); - using (log4net.NDC.Push(string.Format("SqlException: ID={0} MESSAGE={1}{2}Diagnostics:{2}{3}", sql_ex.Number.ToString(), sql_ex.Message, System.Environment.NewLine, sql_ex.ToString()))) - { - Logging.TSControlPanelLog.Error("Encountered unhandled SqlException"); - } - } - else - { - using (log4net.NDC.Push(string.Format("Exception: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString()))) - { - Logging.TSControlPanelLog.Error("Encountered unhandled Exception"); - } - } - } } }
ViewVC Help | |
Powered by ViewVC 1.1.22 |