public bool MoveNext() { DisposeCurrent(); ISegment segment; if (!_reverse) { _enumSegment.Next(out segment, ref _currentPartIndex, ref _currentSegmentIndex); } else { _enumSegment.Previous(out segment, ref _currentPartIndex, ref _currentSegmentIndex); } if (segment == null) { _current = null; } else { if (_recycling && !Recycle) { _current = GeometryFactory.Clone(segment); Marshal.ReleaseComObject(segment); } else { _current = segment; } } return(_current != null); }