public virtual void Dispose() { //if (_tradeEntities != null) //{ // _tradeEntities.UnInitialize(); // _tradeEntities = null; //} if (_statistics != null) { _statistics.Dispose(); _statistics = null; } _dataDelivery = null; _manager = null; if (_provider != null) { _provider.AccountInfoUpdateEvent -= new AccountInfoUpdateDelegate(_provider_AccountInfoUpdateEvent); _provider.OperationalStateChangedEvent -= new OperationalStateChangedDelegate(_provider_OperationalStatusChangedEvent); _provider = null; } }