aboutsummaryrefslogtreecommitdiff
path: root/RhSolutions.ExcelExtensions/Row.cs
diff options
context:
space:
mode:
Diffstat (limited to 'RhSolutions.ExcelExtensions/Row.cs')
-rw-r--r--RhSolutions.ExcelExtensions/Row.cs54
1 files changed, 0 insertions, 54 deletions
diff --git a/RhSolutions.ExcelExtensions/Row.cs b/RhSolutions.ExcelExtensions/Row.cs
deleted file mode 100644
index 01df2e4..0000000
--- a/RhSolutions.ExcelExtensions/Row.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-namespace RhSolutions.ExcelExtensions;
-
-public sealed class Row
-{
- public Table ParentTable { get; }
- public int Index
- {
- get => _range.Row - ParentTable.Range.Row;
- }
- public int Length
- {
- get => _range.Columns.Count;
- }
- private readonly Cell[] _cells;
- private readonly Range _range;
-
- public Row(Range range, Table table)
- {
- _cells = new Cell[range.Columns.Count];
- _range = range;
- ParentTable = table ??
- throw new ArgumentNullException("table");
- }
-
- public Cell this[int index]
- {
- get
- {
- if (index < 0 || index >= Length)
- {
- throw new IndexOutOfRangeException();
- }
-
- if (_cells[index] == null)
- {
- _cells[index] = new Cell(_range.Cells[1, index + 1], ParentTable);
- return _cells[index];
- }
- else
- {
- return _cells[index];
- }
- }
- }
-
- public Cell this[string header]
- {
- get
- {
- int columnIndex = ParentTable.ColumnByHeader(header).Index;
- return this[columnIndex];
- }
- }
-}