17 using System.Collections;
18 using System.Collections.Generic;
32 private bool _needsMoveNext =
true;
35 private readonly IEnumerator<BaseData> _enumerator;
46 _enumerator = enumerator;
47 _timeProvider = timeProvider;
48 _offsetProvider = offsetProvider;
60 var underlyingCurrent = _enumerator.Current;
61 var frontier = _timeProvider.GetUtcNow();
62 var localFrontier =
new DateTime(frontier.Ticks + _offsetProvider.GetOffsetTicks(frontier));
65 if (!_needsMoveNext && underlyingCurrent !=
null)
67 if (underlyingCurrent.EndTime <= localFrontier)
70 _current = underlyingCurrent;
71 _needsMoveNext =
true;
77 _needsMoveNext =
false;
83 if (_needsMoveNext && !_enumerator.MoveNext())
85 _needsMoveNext =
true;
90 underlyingCurrent = _enumerator.Current;
92 if (underlyingCurrent !=
null && underlyingCurrent.EndTime <= localFrontier)
94 _needsMoveNext =
true;
95 _current = underlyingCurrent;
100 _needsMoveNext = underlyingCurrent ==
null;
125 get {
return _current; }
135 object IEnumerator.Current
146 _enumerator.Dispose();