protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _monitor?.Dispose(); } _disposedValue = true; } }
/// <summary> /// Stops the monitor if it is active. /// </summary> public void Stop() { _monitor.DataSentEventHandler = null; _monitor.DataReceivedEventHandler = null; _monitor.Stop(); _monitor.Dispose(); _monitor = null; _sentDecoders.Clear(); _receivedDecoders.Clear(); }