public void Reset() { _next = null; Current = null; _enumerator.Reset(); PerformIteration(); }
private void PerformIteration() { if (!_enumerator.MoveNext()) { Current = _next != null ? new EnumeratorValue <T>(_next.Value, _index++, true) : null; _next = null; return; } if (_next == null) { _next = new Container <T>((T)_enumerator.Current); return; } Current = new EnumeratorValue <T>(_next.Value, _index++, false); _next.Value = (T)_enumerator.Current; }