Ejemplo n.º 1
0
        static void StartApplication()
        {
            frmMainMenu mainTemp = null;

            try
            {
                HTN.BITS.FGTRACK.LIB.ResourceManager.Instance.CallingAssembly = Assembly.GetExecutingAssembly();
                GlobalVariable.LanguageSelect = "fr-CA"; //fr-CA is Thai

                clsBarcodeReader.Instance.InitialComponent();
                //ServiceProvider.Instance.Connect();

                //fMain = new frmMainMenu();
                //Application.Run(fMain);
                using (frmMainMenu fMain = new frmMainMenu())
                {
                    GC.ReRegisterForFinalize(fMain);

                    mainTemp = fMain;
                    Application.Run(fMain);

                    ServiceProvider.Instance.Disconnect();
                    clsBarcodeReader.Instance.Release();

                    mainTemp = null;
                    GC.SuppressFinalize(fMain);

                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }


                if (mainTemp != null)
                {
                    FullScreenHandle.StopFullScreen(mainTemp);
                    GC.SuppressFinalize(mainTemp);

                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                }

                Application.Exit();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                if (mainTemp != null)
                {
                    FullScreenHandle.StopFullScreen(mainTemp);
                    GC.SuppressFinalize(mainTemp);
                }

                GC.Collect();
                GC.WaitForPendingFinalizers();

                Application.Exit();
            }
        }
Ejemplo n.º 2
0
        void IDisposable.Dispose()
        {
            base.PowerMgr.PowerNotify -= new EventHandler(OnPowerNotify);
            base.PowerMgr.DisableNotifications();
            base.PowerMgr.Dispose();

            FullScreenHandle.StopFullScreen(this);

            GC.SuppressFinalize(this);
        }
Ejemplo n.º 3
0
 private void frmMainMenu_Closing(object sender, CancelEventArgs e)
 {
     FullScreenHandle.StopFullScreen(this);
 }
Ejemplo n.º 4
0
 private void frmProductFinish_Closing(object sender, CancelEventArgs e)
 {
     FullScreenHandle.StopFullScreen(this);
 }