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

Diff of /trunk/TSAdminTool/frmAdmin.cs

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

revision 57 by william, Thu Jul 12 16:47:17 2012 UTC revision 61 by william, Thu Jul 12 17:34:46 2012 UTC
# Line 9  namespace AnywhereTS Line 9  namespace AnywhereTS
9      using System.Windows.Forms;      using System.Windows.Forms;
10      using System.Runtime.InteropServices;      using System.Runtime.InteropServices;
11      using System.IO;      using System.IO;
12      using System.Data.SqlClient; // For File operations      using System.Data.SqlClient;
13        using System.Security.Permissions; // For File operations
14            
15    
16      public partial class frmAdmin : Form      public partial class frmAdmin : Form
# Line 23  namespace AnywhereTS Line 24  namespace AnywhereTS
24          private string selectedClientMacAddress; // The MAC address of the currently selected client.          private string selectedClientMacAddress; // The MAC address of the currently selected client.
25          public frmAdmin()          public frmAdmin()
26          {          {
27              InitializeComponent();              InitializeComponent();            
28              AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);          }  
         }  
   
         static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)  
         {  
             Exception ex = (e.ExceptionObject as Exception);  
             if (ex == null)  
             {  
                 Logging.ATSAdminLog.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.ATSAdminLog.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.ATSAdminLog.Error("Encountered unhandled Exception");  
                 }  
             }  
         }  
29    
30          private void frmAdmin_Load(object sender, EventArgs e)          private void frmAdmin_Load(object sender, EventArgs e)
31          {          {            
32              this.Cursor = Cursors.WaitCursor;              //this.Cursor = Cursors.WaitCursor;
33    
34              UpdateControlsToReflectProgramVersion();              UpdateControlsToReflectProgramVersion();
35    
# Line 763  namespace AnywhereTS Line 738  namespace AnywhereTS
738    
739    
740          // Configure AnywhereTS          // Configure AnywhereTS
741          // Run first time starting ATS and can also be invoked from the Tools menu.          // Run first time starting ATS and can also be invoked from the Tools menu.        
742          private bool ConfigureATS()          private bool ConfigureATS()
743          {          {
744    
745              DialogResult result;              DialogResult result;
746    
747              if (!ProSupport.IsAnAdministrator())              if (!ProSupport.IsAnAdministrator())

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

  ViewVC Help
Powered by ViewVC 1.1.22