void IDisposable.Dispose()
        {
            this.powerManager.PowerNotify -= new EventHandler(OnPowerNotify);
            this.powerManager.DisableNotifications();
            this.powerManager.Dispose();

            FullScreenHandle.StopFullScreen(this);

            GC.SuppressFinalize(this);
        }
        public frmNewLockDown()
        {
            InitializeComponent();
            base.UpdateResourcesInForm("en-US");

            this.powerManager = new PowerManagement();

            base.UpdateResourcesInForm(GlobalVariable.LanguageSelect);
            FullScreenHandle.StartFullScreen(this);

            this.txtEsc.Text = string.Empty;
        }
Exemple #3
0
        static void Main()
        {
            frmNewLockDown tempLock = null;

            try
            {
                HTN.BITS.MCS.SCN.LIB.ResourceManager.Instance.CallingAssembly = Assembly.GetExecutingAssembly();
                GlobalVariable.LanguageSelect = MobileConfiguration.Configuration.Settings["DefaultLanguage"].ToString();

                //clsBarcodeReader.Instance.InitialComponent();

                //Application.Run(new frmLockDown());
                using (frmNewLockDown fLockDown = new frmNewLockDown())
                {
                    GC.ReRegisterForFinalize(fLockDown);

                    tempLock = fLockDown;
                    Application.Run(fLockDown);

                    //clsBarcodeReader.Instance.Release();

                    tempLock = null;
                    GC.SuppressFinalize(fLockDown);

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

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

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

                Application.Exit();
            }
            catch (Exception ex)
            {
                if (tempLock != null)
                {
                    FullScreenHandle.StopFullScreen(tempLock);
                    GC.SuppressFinalize(tempLock);
                }

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

                Application.Exit();
            }
        }
        private void OpenApplication(string appName)
        {
            try
            {
                string codeBase = Assembly.GetExecutingAssembly().GetName().CodeBase;
                string appPath  = Path.GetDirectoryName(codeBase).Replace("bits_lockdown", string.Empty);

                string startAppName = string.Format("{0}\\{1}", appPath, appName);

                if (File.Exists(startAppName))
                {
                    this.IsRunning = true;

                    CreateLaunchApp.LaunchApp(startAppName, string.Empty);

                    this.IsRunning = false;
                    FullScreenHandle.StartFullScreen(this);
                    this.txtEsc.Text = string.Empty;

                    Cursor.Current = Cursors.Default;
                    Cursor.Show();
                }
                else
                {
                    Cursor.Current = Cursors.Default;
                    Cursor.Show();

                    this.IsRunning = false;
                    MessageBox.Show(startAppName + "\nFile Not Exist");
                }
            }
            catch (Exception ex)
            {
                this.IsRunning = false;
                MessageBox.Show(ex.Message, "OpenApplication");
            }
        }