18 using System.Collections;
19 using System.Collections.Generic;
32 private readonly DateTimeZone _timeZone;
33 private readonly TimeSpan _maximumDataAge;
35 private readonly IEnumerator<BaseData> _enumerator;
46 _enumerator = enumerator;
47 _timeProvider = timeProvider;
49 _maximumDataAge = maximumDataAge;
61 while (_enumerator.MoveNext())
64 if (_enumerator.Current ==
null || _enumerator.Current.Time == DateTime.MinValue)
71 if (_current !=
null && _current.
EndTime > _enumerator.Current.EndTime)
77 var age = _timeProvider.GetUtcNow().ConvertFromUtc(_timeZone) - _enumerator.Current.
EndTime;
78 if (age <= _maximumDataAge)
80 _current = _enumerator.Current;
107 get {
return _current; }
117 object IEnumerator.Current
119 get {
return _current; }
128 _enumerator.Dispose();