private void Main_FormClosing(object sender, FormClosingEventArgs e) { // Turn off all LED(s) if (LEDStatusLightingUtil.Instance.IsPortOpen) { //LEDStatusLightingUtil.Instance.TurnOffAllLEDs(); LEDStatusLightingUtil.Instance.ClosePort(); } //if (DocumentScannerUtil.Instance.EnableFeeder) //{ // DocumentScannerUtil.Instance.StopScanning(); //} if (DocumentScannerUtil.Instance.Scanner_Connected) { DocumentScannerUtil.Instance.Disconnect(); } BarcodeScannerUtil.Instance.Disconnect(); FacialRecognition.Instance.Dispose(); Application.ExitThread(); APIUtils.Dispose(); }
private void Main_FormClosing(object sender, FormClosingEventArgs e) { try { // Turn off all LED(s) if (LEDStatusLightingUtil.Instance.IsPortOpen) { //LEDStatusLightingUtil.Instance.TurnOffAllLEDs(); LEDStatusLightingUtil.Instance.ClosePort(); } FacialRecognition.Instance.Dispose(); BarcodeScannerUtil.Instance.Disconnect(); //_autoPrintTimer.Enabled = false; Application.ExitThread(); APIUtils.Dispose(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }