예제 #1
0
        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();
            }
        }
예제 #2
0
 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();
     }
 }