// null out the forms so we know to create a new one. private void scanForm_Closed(object sender, EventArgs e) { scanForm.releaseScanner(); scanForm = null; }
/// <summary> /// This method creates a ScannerConfig form and connects it to the scanner. /// </summary> private void InitializeScannerConfigForm() { if (scanForm == null) { scanForm = new ScannerConfig { ScannerName = Properties.Settings.Default.USBScannerName }; } scanForm.FormClosed += scanForm_Closed; scanForm.connectScanner(); }