using System.Collections; namespace RhSolutions.ExcelExtensions; public class RowsEnumerator : IEnumerator { private Rows _rows; private int position = -1; object IEnumerator.Current { get { return Current; } } public Row Current { get { try { return _rows[position]; } catch (IndexOutOfRangeException) { throw new InvalidOperationException(); } } } public RowsEnumerator(Rows rows) { _rows = rows; } public bool MoveNext() { position++; return (position < _rows.Length); } public void Reset() { position = -1; } public void Dispose() { } }