コード例 #1
0
 public static void RaiseTimeZoneChangedEvent(string timeZone, TimeZoneStatus status)
 {
     if (TimeZoneChangedEvent != null)
     {
         TimeZoneChangedEvent(timeZone, status);
     }
 }
コード例 #2
0
 private void Events_TimeZoneChangedEvent(string timeZone, TimeZoneStatus status)
 {
     Application.Current.Dispatcher.InvokeAsync(() =>
     {
         if (timeZone == BreakOutTimeZone)
         {
             if (status == TimeZoneStatus.Started)
             {
                 var dictionary = Stocks.ToDictionary(s => s.TradingSymbol, val => val.PreOpenPrice);
                 StockHighLowWatchManager.Instance.WatchStocksForHighLow(dictionary);
             }
             else if (status == TimeZoneStatus.Stopped)
             {
                 Stocks = new ObservableCollection <RangeBreakOutStockConfig>(Stocks.Where(s => s.ChangePercentage <= 1.5m));
                 StockHighLowWatchManager.Instance.Stop();
                 RangeBreakOutManager.Instance.WatchStocksForRangeBreakout(Stocks);
             }
         }
     });
 }