public frmLockDown() { InitializeComponent(); base.UpdateResourcesInForm("en-US"); this.powerManager = new PowerManagement(); FullScreenHandle.StartFullScreen(this); this.txtEsc.Text = string.Empty; }
//private TextBox TextFocusedFirstLoop() //{ // // Look through all the controls on this form. // foreach (Control con in this.Controls) // { // // Every control has a Focused property. // if (con.Focused == true) // { // // Try to cast the control to a TextBox. // TextBox textBox = con as TextBox; // if (textBox != null) // { // return textBox; // We have a TextBox that has focus. // } // } // } // return null; // No suitable TextBox was found. //} #endregion #region IDisposable Members void IDisposable.Dispose() { this.powerManager.PowerNotify -= new EventHandler(OnPowerNotify); this.powerManager.DisableNotifications(); this.powerManager.Dispose(); FullScreenHandle.StopFullScreen(this); GC.SuppressFinalize(this); }
static void Main() { frmLockDown tempLock = null; try { HTN.BITS.FGTRACK.LIB.ResourceManager.Instance.CallingAssembly = Assembly.GetExecutingAssembly(); // clsBarcodeReader.Instance.InitialComponent(); //Application.Run(new frmLockDown()); using (frmLockDown fLockDown = new frmLockDown()) { 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(); } }
public frmLockDown() { InitializeComponent(); base.UpdateResourcesInForm("en-US"); FullScreenHandle.StartFullScreen(this); this.txtEsc.Text = string.Empty; //this.temp_Serial = GlobalVariable.GetSerialNumber().Replace(@"\0", ""); //this.SCN_SERIAL = temp_Serial.Substring(temp_Serial.IndexOf("#") + 1, temp_Serial.Length - 9); this.IP_ADDRESS = string.Format("IP: {0}", GlobalVariable.GetIPAddress()); }
private void OpenApplication(string appName, Button btnActive) { 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); //using (Process proc = new Process()) //{ // proc.StartInfo.FileName = startAppName; // proc.StartInfo.Arguments = string.Empty; // proc.Start(); // proc.WaitForExit(); //} 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"); } Bt.ScanLib.Control.btScanDisable(); btnActive.Focus(); } catch (Exception ex) { this.IsRunning = false; MessageBox.Show(ex.Message); } }