using System.Collections; namespace RhSolutions.ExcelTable; public sealed class ExcelRow : ExcelTable, IEnumerable { public int Index { get => Range.Row - ParentTable.Range.Row; } public int Length { get => Range.Columns.Count; } public ExcelRow(Range range, ExcelTable table) : base(range, table) { Range = range; ParentTable = table; } public ExcelTableCell this[int index] { get => new(Range.Cells[1, index + 1], ParentTable); } public IEnumerator GetEnumerator() { return new ExcelRowEnumerator(Range, ParentTable); } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); }