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