public void Dispose() { if (_cfBroker != null) { _cfBroker.Dispose(); _cfBroker = null; } if (_connectionTimer != null) { _connectionTimer.Dispose(); _connectionTimer = null; } foreach (var dataSource in DataSources.Where(ds => ds.Value is IDisposable)) { ((IDisposable)dataSource.Value).Dispose(); } /*if (DataSources.ContainsKey("Interactive Brokers")) * { * ((IB)DataSources["Interactive Brokers"]).Dispose(); * }*/ if (_arrivedBars != null) { _arrivedBars.Dispose(); } }
public void Dispose() { if (_cfBroker != null) { _cfBroker.Dispose(); _cfBroker = null; } if (_connectionTimer != null) { _connectionTimer.Dispose(); _connectionTimer = null; } if (DataSources.ContainsKey("Interactive Brokers")) { ((IB)DataSources["Interactive Brokers"]).Dispose(); } if (_arrivedBars != null) { _arrivedBars.Dispose(); } }