/[AnywhereTS-MSSQL]/trunk/TSControlPanel/Program.cs
ViewVC logotype

Diff of /trunk/TSControlPanel/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/TSControlPanel/Program.cs	2012/07/12 22:00:37	73
+++ trunk/TSControlPanel/Program.cs	2012/07/14 02:52:23	94
@@ -16,18 +16,21 @@
         [STAThread]
         static void Main()
         {
-            AppDomain currentDomain = AppDomain.CurrentDomain;
-            currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
-            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException, true);
+            using (log4net.NDC.Push("Code executed from TSControlPanel.exe"))
+            {
+                AppDomain currentDomain = AppDomain.CurrentDomain;
+                currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException, true);
 
-            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
+                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
 
-            Application.EnableVisualStyles();
-            Application.SetCompatibleTextRenderingDefault(false);
+                Application.EnableVisualStyles();
+                Application.SetCompatibleTextRenderingDefault(false);
 
-            frmClientProperties objCustomDialogBox = new frmClientProperties();
-            objCustomDialogBox.dialogMode = frmClientProperties.ATSClientMode.CONTROL_PANEL; // Select the mode to run the form in.
-            Application.Run(objCustomDialogBox);            
+                frmClientProperties objCustomDialogBox = new frmClientProperties();
+                objCustomDialogBox.dialogMode = frmClientProperties.ATSClientMode.CONTROL_PANEL; // Select the mode to run the form in.
+                Application.Run(objCustomDialogBox);
+            }
         }
 
         static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)

 

  ViewVC Help
Powered by ViewVC 1.1.22