aboutsummaryrefslogtreecommitdiff
path: root/RhSolutions.ExcelExtensions/Column.cs
diff options
context:
space:
mode:
Diffstat (limited to 'RhSolutions.ExcelExtensions/Column.cs')
-rw-r--r--RhSolutions.ExcelExtensions/Column.cs65
1 files changed, 0 insertions, 65 deletions
diff --git a/RhSolutions.ExcelExtensions/Column.cs b/RhSolutions.ExcelExtensions/Column.cs
deleted file mode 100644
index 341897c..0000000
--- a/RhSolutions.ExcelExtensions/Column.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-namespace RhSolutions.ExcelExtensions;
-
-public sealed class Column
-{
- public Table ParentTable { get; }
- public string Header
- {
- get => _range.Cells[1, 1].Value2.ToString() ?? String.Empty;
- }
- public int Index
- {
- get => _range.Column - ParentTable.Range.Column;
- }
- public int Length
- {
- get => _range.Rows.Count;
- }
- private Cell[] _cells;
- private readonly Range _range;
-
- public Column(Range range, Table table)
- {
- _cells = new Cell[range.Rows.Count];
- _range = range;
- ParentTable = table ??
- throw new ArgumentNullException("table");
- }
-
- public Cell this[int index]
- {
- get
- {
- if (_cells[index] == null)
- {
- _cells[index] = new Cell(_range.Cells[index + 1, 1], ParentTable);
- return _cells[index];
- }
- else
- {
- return _cells[index];
- }
- }
- set
- {
- if (_cells[index] == null)
- {
- _cells[index] = new Cell(_range.Cells[index + 1, 1], ParentTable);
- _cells[index].Value = value;
- }
- else
- {
- _cells[index].Value = value;
- }
- }
- }
-
- public Column AddLeft()
- {
- _range.EntireColumn
- .Insert(XlInsertShiftDirection.xlShiftToRight,
- XlInsertFormatOrigin.xlFormatFromRightOrBelow);
-
- return ParentTable.Columns[this.Index - 1];
- }
-}