Ejemplo n.º 1
0
        static void Main()
        {
            // var setting = VisibilitySetting.HandleUnits;

            //                              ERROR LOGGING                                    ///

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new ThreadExceptionEventHandler(LogUnhandledException);
            // Set the unhandled exception mode to force all Windows Forms errors to go through
            // our handler.
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            // Add the event handler for handling non-UI thread exceptions to the event.
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            //                                                                            //
            //DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.UserSkins.BonusSkins.Register();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                ConnStringManager = new ConnectionStringManager.ConnectionStringManager(RegKey, PrevConnectionStringKey);
                StockoutIndexBuilder.Settings.ConnectionString = Registry.GetValue("HKEY_CURRENT_USER\\Software\\JSI\\HCMIS\\Configuration", "ConnectionString", null).ToString();
            }
            catch
            {
            }
            if (ApplicationDeployment.IsNetworkDeployed)
            {
                HCMIS = ApplicationDeployment.CurrentDeployment;
                HCMIS.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(HCMIS_CheckForUpdateCompleted);
                HCMIS.UpdateCompleted         += new System.ComponentModel.AsyncCompletedEventHandler(HCMIS_UpdateCompleted);
            }

            // Create necessary database tables (if they do not exist already)
            CreateDatabaseTables();


            //If the user opens the application while holding down the shift key, we want to open the configuration options before the login form.
            if (Control.ModifierKeys == Keys.Shift)
            {
                Application.Run(new LoginForm(true));
            }

            Application.Run(new LoginForm());
        }
        static void Main()
        {
            // var setting = VisibilitySetting.HandleUnits;

            //                              ERROR LOGGING                                    ///

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new ThreadExceptionEventHandler(LogUnhandledException);
            // Set the unhandled exception mode to force all Windows Forms errors to go through
            // our handler.
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            // Add the event handler for handling non-UI thread exceptions to the event.
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
               //                                                                            //
            //DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.UserSkins.BonusSkins.Register();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                ConnStringManager = new ConnectionStringManager.ConnectionStringManager(RegKey, PrevConnectionStringKey);
                StockoutIndexBuilder.Settings.ConnectionString = Registry.GetValue("HKEY_CURRENT_USER\\Software\\JSI\\HCMIS\\Configuration", "ConnectionString", null).ToString();
            }
            catch
            {
            }
            if (ApplicationDeployment.IsNetworkDeployed)
            {
                HCMIS = ApplicationDeployment.CurrentDeployment;
                HCMIS.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(HCMIS_CheckForUpdateCompleted);
                HCMIS.UpdateCompleted += new System.ComponentModel.AsyncCompletedEventHandler(HCMIS_UpdateCompleted);
            }

            // Create necessary database tables (if they do not exist already)
            CreateDatabaseTables();

            //If the user opens the application while holding down the shift key, we want to open the configuration options before the login form.
            if (Control.ModifierKeys == Keys.Shift)
            {
                Application.Run(new LoginForm(true));
            }

            Application.Run(new LoginForm());
        }