예제 #1
0
        private void OnTickerLoading(TickerFileViewModel tickerVM)
        {
            LoadingCount++;

            tickers.Add(tickerVM);
            tickerVM.ExecuteWhenLoadCompletes(OnLoadingEnd);
            tickerVM.CloseCommandExecuted += OnCloseCommand;
        }
예제 #2
0
 private void OnTickerLoaded(TickerFileViewModel tickerVM)
 {
     LoadingCount--;
     LoadedCount++;
     RecalculateIndicesFrom(tickers.IndexOf(tickerVM));
 }
예제 #3
0
 private void OnTickerError(TickerFileViewModel tickerVM)
 {
     LoadingCount--;
     ErrorCount++;
 }
예제 #4
0
 private void OnLoadingEnd(TickerFileViewModel tickerVM)
 {
     if (tickerVM.LoadState == AsyncState.Error)
         OnTickerError(tickerVM);
     else
         OnTickerLoaded(tickerVM);
 }
예제 #5
0
        private void OnCloseCommand(TickerFileViewModel tickerVM)
        {
            ChangeCount(tickerVM.LoadState, false);

            int index = tickers.IndexOf(tickerVM);
            tickers.Remove(tickerVM);
            RecalculateIndicesFrom(index);
        }
예제 #6
0
 private void OnClearAll()
 {
     var tickersCopy = new TickerFileViewModel[tickers.Count];
     tickers.CopyTo(tickersCopy, 0);
     tickers.Clear();
     foreach (var t in tickersCopy.Where(x => x.LoadState == AsyncState.Running))
         t.RemoveNotification(OnLoadingEnd);
     LoadingCount = 0;
     ErrorCount = 0;
     LoadedCount = 0;
 }