예제 #1
0
 private void OnRecordsShrunk(TimeRecordCollection <T> serie, int oldItemsCount)
 {
     lock (Locker)
     {
         int itemsRemoved = oldItemsCount - serie.Count;
         Cursor = Cursor - itemsRemoved;
         Debug.Assert(Cursor > -1 || Cursor <= -itemsRemoved, "Cursor is meant to be >= 0 unless it was 0 ( - itemsRemoved now )");
         if (Cursor < 0)
         {
             Cursor = 0;
         }
     }
 }
예제 #2
0
 public TimeSerieNavigator(IEnumerable <T> items)
 {
     Records            = new TimeRecordCollection <T>(items);
     Records.NewRecord += Records_NewRecord;
     Records.OnShrink  += OnRecordsShrunk;
 }
예제 #3
0
 private void Records_NewRecord(TimeRecordCollection <T> sender, T rec)
 {
     OnNewRecord?.Invoke(rec);
 }
예제 #4
0
 public TimeSerieNavigator()
 {
     Records            = new TimeRecordCollection <T>();
     Records.NewRecord += Records_NewRecord;;
     Records.OnShrink  += OnRecordsShrunk;
 }