forked from ExcelDataReader/ExcelDataReader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCellRange.cs
More file actions
55 lines (46 loc) · 1.47 KB
/
Copy pathCellRange.cs
File metadata and controls
55 lines (46 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using ExcelDataReader.Core;
namespace ExcelDataReader
{
/// <summary>
/// A range for cells using 0 index positions.
/// </summary>
public sealed class CellRange
{
internal CellRange(string from, string to)
{
int fromColumn, fromRow, toColumn, toRow;
ReferenceHelper.ParseReference(from, out fromColumn, out fromRow);
// 0 indexed vs 1 indexed
FromColumn = fromColumn - 1;
FromRow = fromRow - 1;
ReferenceHelper.ParseReference(to, out toColumn, out toRow);
// 0 indexed vs 1 indexed
ToColumn = toColumn - 1;
ToRow = toRow - 1;
}
internal CellRange(int fromColumn, int fromRow, int toColumn, int toRow)
{
FromColumn = fromColumn;
FromRow = fromRow;
ToColumn = toColumn;
ToRow = toRow;
}
/// <summary>
/// Gets the column the range starts in
/// </summary>
public int FromColumn { get; private set; }
/// <summary>
/// Gets the row the range starts in
/// </summary>
public int FromRow { get; private set; }
/// <summary>
/// Gets the column the range ends in
/// </summary>
public int ToColumn { get; private set; }
/// <summary>
/// Gets the row the range ends in
/// </summary>
public int ToRow { get; private set; }
}
}