/[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 59 by william, Thu Jul 12 17:03:02 2012 UTC revision 61 by william, Thu Jul 12 17:34:46 2012 UTC
# Line 6  using System.Drawing; Line 6  using System.Drawing;
6  using System.Text;  using System.Text;
7  using System.Windows.Forms;  using System.Windows.Forms;
8  using System.Data.SqlClient;  using System.Data.SqlClient;
9    using System.Security.Permissions;
10    
11  namespace AnywhereTS  namespace AnywhereTS
12  {  {
# Line 15  namespace AnywhereTS Line 16  namespace AnywhereTS
16          {          {
17              InitializeComponent();                        InitializeComponent();          
18          }          }
         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");  
                 }  
             }  
         }  
19    
20          public enum ATSClientMode //The modes that this form can be started in.          public enum ATSClientMode //The modes that this form can be started in.
21              { EDIT_CLIENT, // Normal mode edit a client (only admins)              { EDIT_CLIENT, // Normal mode edit a client (only admins)
# Line 64  namespace AnywhereTS Line 41  namespace AnywhereTS
41    
42          bool changedByUser = true; // Used on some checkbox controls to determine if state was changed by user or code.          bool changedByUser = true; // Used on some checkbox controls to determine if state was changed by user or code.
43    
44          
45          private void frmClientProperties_Load(object sender, EventArgs e)          private void frmClientProperties_Load(object sender, EventArgs e)
46          {          {
             AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);  
47              //this.Cursor = Cursors.WaitCursor;              //this.Cursor = Cursors.WaitCursor;
48              changedByUser = false; // To prevent the some controls from triggering changed event.              changedByUser = false; // To prevent the some controls from triggering changed event.
49    

Legend:
Removed from v.59  
changed lines
  Added in v.61

  ViewVC Help
Powered by ViewVC 1.1.22