/// <summary> /// On shutdown we need to dispose our object manually before disposing the control /// </summary> public new void Dispose() { addLog("Dispose() called..."); #if USE_ENTER_KEY #else _continueWait = false; //signal thread to stop Thread.Sleep(100); SystemEvent waitEvent = new SystemEvent("EndWaitLoop52", false, false); waitEvent.PulseEvent(); Thread.Sleep(100); restoreKey(); #endif if (IntermecCamera != null) { #if STREAMING_ON addLog("...Dispose() we DO NOT SWITCH streaming"); #else IntermecCamera.Streaming = false; #endif IntermecCamera.Dispose(); IntermecCamera = null; } #if USE_ENTER_KEY #else //enable HW Trigger of Scanner //S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true); YetAnotherHelperClass.setHWTrigger(true); #endif #if REMAP_SCAN_TO_ENTERKEY restoreScanKey(); #endif Cursor.Current = Cursors.Default; //base.Dispose(); do not use!! addLog("...Dispose() finished"); }
/// <summary> /// On shutdown we need to dispose our object manually before disposing the control /// </summary> public new void Dispose() { addLog("Dispose() called..."); if (waitThread != null) { _continueWait = false; //signal thread to stop Thread.Sleep(100); SystemEvent waitEvent = new SystemEvent("EndWaitLoop52", false, false); waitEvent.PulseEvent(); Thread.Sleep(100); } //now the wait thread should been stopped if (IntermecCamera != null) { #if STREAMING_ON addLog("...Dispose() we DO NOT SWITCH streaming"); IntermecCamera.Streaming = false; #else IntermecCamera.Streaming = false; #endif IntermecCamera.Dispose(); IntermecCamera = null; } YetAnotherHelperClass.setHWTrigger(true); ITCTools.KeyBoard.restoreKey(); Cursor.Current = Cursors.Default; //Dispose() //base.Dispose(); do not use!! addLog("...Dispose() finished"); }
public new void Dispose() { addLog("IntermecScanControl Dispose()..."); _continueWait = false; //signal threads to stop SystemEvent waitEvent = new SystemEvent("EndWaitLoop52", false, false); waitEvent.PulseEvent(); System.Threading.Thread.Sleep(100); int iTry = 0; while (_bWaitLoopRunning && iTry < 5) { System.Threading.Thread.Sleep(300); iTry++; } addLog("IntermecScanControl Dispose(): ending Threads..."); //is the waitThread (waitLoop) still running? if (waitThread != null) { addLog("IntermecScanControl Dispose(): ending event watch thread ..."); waitThread.Abort(); } //is there still a readThread running? if (readThread != null) { addLog("IntermecScanControl Dispose(): ending Barcode reading thread ..."); readThread.Abort(); } if (bcr != null) { addLog("IntermecScanControl Dispose(): Calling ScannerOnOff(false)..."); scannerOnOff(false); addLog("IntermecScanControl Dispose(): Disposing BarcodeReader..."); //bcr.ThreadedRead(false); bcr.BarcodeRead -= bcr_BarcodeRead; bcr.Dispose(); bcr = null; addLog("IntermecScanControl Dispose(): BarcodeReader disposed"); } try { addLog("IntermecScanControl Dispose(): enabling HardwareTrigger..."); //replaced this call as ADCComInterface made problems //S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true); YetAnotherHelperClass.setHWTrigger(true); YetAnotherHelperClass.setNumberOfGoodReadBeeps(1); } catch (Exception ex) { addLog("IntermecScanControl Dispose(), Exception: enabling HardwareTrigger: " + ex.Message); } addLog("IntermecScanControl Dispose(): restoring Scan Button Key..."); ITCTools.KeyBoard.restoreKey(); addLog("...IntermecScanControl Dispose(): end."); //base.Dispose(); do not use!! }
public new void Dispose() { addLog("Dispose() called..."); _continueWait = false; //signal thread to stop Thread.Sleep(100); SystemEvent waitEvent = new SystemEvent("EndWaitLoop52", false, false); waitEvent.PulseEvent(); Thread.Sleep(100); #if STREAMING_ON //kill SnapShot Thread if (snapshotThread != null) { int iCount = 0; while (iCount < 10 && _bSnapShotThreadRunning) { Thread.Sleep(500); iCount++; } if (_bSnapShotThreadRunning) { if (snapshotThread != null) { snapshotThread.Abort(); } } } #endif Thread.Sleep(100); if (_imager != null) { //restore AimerFlashing mode _imager.AimerFlashing = Imager.AimerFlashingMode.Auto; _imager.LightGoal = 128; _imager.VideoRunning = false; _imager.Dispose(); _imager = null; } //enable HW Trigger of Scanner //S9CconfigClass.S9Cconfig.HWTrigger.setHWTrigger(true); //removed as problems with ADCComInterface YetAnotherHelperClass.setHWTrigger(true); restoreKey(); Cursor.Current = Cursors.Default; // base.Dispose(); do not use!! addLog("...Dispose() finished"); }