protected override void Dispose(bool disposing) { if (!disposing) { return; } CancelPendingOperations(); StopThread(); Rs232Module.ClosePort(); Thread.Sleep(500); if (_fridgeType == FridgeType.FT_CAREL) { if (_tempFridgeReaderCarel != null) { _tempFridgeReaderCarel.StopThread(); Thread.Sleep(500); _tempFridgeReaderCarel = null; } } if (_fridgeType == FridgeType.FT_EVERCOM) { if (_tempFridgeReaderEvercom == null) { return; } _tempFridgeReaderEvercom.StopThread(); Thread.Sleep(500); _tempFridgeReaderEvercom = null; } if (_fridgeType == FridgeType.FT_PT100) { if (_tempFridgeReaderPT100 == null) { return; } _tempFridgeReaderPT100.StopThread(); Thread.Sleep(500); _tempFridgeReaderPT100 = null; } if (_fridgeType == FridgeType.FT_FANEM) { if (_tempFridgeFanem == null) { return; } _tempFridgeFanem.StopThread(); Thread.Sleep(500); _tempFridgeFanem = null; } }
protected virtual void Dispose(bool disposing) { if (!disposing) { return; } CancelPendingOperations(); StopThread(); Rs232Module.ClosePort(); Thread.Sleep(500); }
protected override void Dispose(bool disposing) { if (!disposing) { return; } if (LedThread != null) { LedThread.Abort(); LedThread.Join(1000); LedThread = null; } CancelPendingOperations(); StopThread(); Rs232Module.ClosePort(); Thread.Sleep(500); if (_isSchroff) { Rs232Display.ClosePort(); } }