diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-04-07 09:26:52 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-04-07 09:26:52 +0300 |
commit | 3f4d7f45b7f73ec0da32cc0a5d071b7a3a1e9aa1 (patch) | |
tree | b4b4b28a4828b4c4f55901a5b81e08778ded7b20 /RhSolutions.ExcelExtensions/Column.cs | |
parent | 6acba1a542d98f50e9bdaa986d81024623aeeffd (diff) |
Delete Excel.Extensions
Diffstat (limited to 'RhSolutions.ExcelExtensions/Column.cs')
-rw-r--r-- | RhSolutions.ExcelExtensions/Column.cs | 65 |
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]; - } -} |