Пример #1
0
 public void Load()
 {
     try {
         var file = GetLocalDataFile();
         if (File.Exists(file))
         {
             var list    = JToken.Parse(File.ReadAllText(file));
             var current = list.First;
             while (current != null)
             {
                 var manager = new TimeRangeManager();
                 var ranges  = current["TimeRanges"].ToObject <TimeRange[]>();
                 foreach (var range in ranges)
                 {
                     manager.AddRange(range);
                 }
                 var products = current["Products"].ToObject <string>();
                 var keys     = products.Split(',');
                 foreach (var key in keys)
                 {
                     _items[key] = manager;
                 }
                 current = current.Next;
             }
         }
     }
     catch (Exception) {
         // ignored
     }
 }
Пример #2
0
 public MarketDataFilter()
 {
     _default.AddRange(new TimeRange(new TimeSpan(8, 59, 0), new TimeSpan(11, 30, 0), true, false, false));
     _default.AddRange(new TimeRange(new TimeSpan(13, 0, 0), new TimeSpan(15, 0, 0), false, true, false));
 }