using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Collections;
using System.Text;
namespace AnywhereTS
{
static class Program
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException, true);
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
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);
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
CurrentDomain_UnhandledException(sender, new UnhandledExceptionEventArgs(e.Exception, false));
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs args)
{
DialogResult result = DialogResult.Cancel;
Exception e = (Exception)args.ExceptionObject;
if (e == null)
{
Logging.TSControlPanelLog.Error("Encountered unhandled Exception, but the exception was null");
return;
}
if (e.GetType() == typeof(SqlException))
{
SqlException sql_ex = (e as SqlException);
List