/[AnywhereTS-MSSQL]/trunk/TSAdminTool/frmClientProperties.cs
ViewVC logotype

Diff of /trunk/TSAdminTool/frmClientProperties.cs

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

revision 47 by william, Thu Jul 12 14:29:34 2012 UTC revision 57 by william, Thu Jul 12 16:47:17 2012 UTC
# Line 5  using System.Data; Line 5  using System.Data;
5  using System.Drawing;  using System.Drawing;
6  using System.Text;  using System.Text;
7  using System.Windows.Forms;  using System.Windows.Forms;
8    using System.Data.SqlClient;
9    
10  namespace AnywhereTS  namespace AnywhereTS
11  {  {
# Line 13  namespace AnywhereTS Line 14  namespace AnywhereTS
14          public frmClientProperties()          public frmClientProperties()
15          {          {
16              InitializeComponent();              InitializeComponent();
17                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
18            }
19            static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
20            {
21                Exception ex = (e.ExceptionObject as Exception);
22                if (ex == null)
23                {
24                    Logging.TSControlPanelLog.Error("Encountered unhandled Exception, but the exception was null");
25                    return;
26                }
27                if (ex.GetType() == typeof(SqlException))
28                {
29                    SqlException sql_ex = (ex as SqlException);
30                    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())))
31                    {
32                        Logging.TSControlPanelLog.Error("Encountered unhandled SqlException");
33                    }
34                }
35                else
36                {
37                    using (log4net.NDC.Push(string.Format("Exception: MESSAGE={0}{1}Diagnostics:{1}{2}", ex.Message, System.Environment.NewLine, ex.ToString())))
38                    {
39                        Logging.TSControlPanelLog.Error("Encountered unhandled Exception");
40                    }
41                }
42          }          }
   
43    
44          public enum ATSClientMode //The modes that this form can be started in.          public enum ATSClientMode //The modes that this form can be started in.
45              { EDIT_CLIENT, // Normal mode edit a client (only admins)              { EDIT_CLIENT, // Normal mode edit a client (only admins)

Legend:
Removed from v.47  
changed lines
  Added in v.57

  ViewVC Help
Powered by ViewVC 1.1.22