private void ReleaseUpdater() { if (_statisticUpdater != null) { PairStatisticUpdaterProvider.ReleaseUpdater(_statisticUpdater); _statisticUpdater.Changed -= PairStatisticUpdater_Changed; } }
private void NeedStatisticsOf(Market market) { ReleaseUpdater(); if (market == null) { Statistics = null; OnStatisticChanged(); return; } _statisticUpdater = PairStatisticUpdaterProvider.GetUpdater(market, _refreshInterval); _statisticUpdater.Changed += PairStatisticUpdater_Changed; if (_statisticUpdater.LastValue != null) { SetStatistics(_statisticUpdater.LastValue); } _statisticUpdater.Start(); }