Class InMemoryRange
EPPlus implementation of a range that keeps its data in memory
Inheritance
Implements
Inherited Members
Namespace: OfficeOpenXml.FormulaParsing.Ranges
Assembly: EPPlus.dll
Syntax
public class InMemoryRange : IRangeInfo, IAddressInfo, IEnumerator<ICellInfo>, IEnumerator, IDisposable, IEnumerable<ICellInfo>, IEnumerable
Constructors
InMemoryRange(IRangeInfo)
Constructor
Declaration
public InMemoryRange(IRangeInfo ri)
Parameters
Type | Name | Description |
---|---|---|
IRangeInfo | ri | Another IRangeInfo used as clone for this range. The address of the supplied range will not be copied. |
InMemoryRange(FormulaRangeAddress, RangeDefinition)
The constructor
Declaration
public InMemoryRange(FormulaRangeAddress address, RangeDefinition rangeDef)
Parameters
Type | Name | Description |
---|---|---|
FormulaRangeAddress | address | The worksheet address that should be used for this range. Will be used for implicit intersection. |
RangeDefinition | rangeDef | Defines the size of the range |
InMemoryRange(RangeDefinition)
The constructor
Declaration
public InMemoryRange(RangeDefinition rangeDef)
Parameters
Type | Name | Description |
---|---|---|
RangeDefinition | rangeDef | Defines the size of the range |
InMemoryRange(List<List<Object>>)
Constructor
Declaration
public InMemoryRange(List<List<object>> range)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.Collections.Generic.List<System.Object>> | range | A list of values also defining the size of the range |
InMemoryRange(Int32, Int16)
Constructor
Declaration
public InMemoryRange(int rows, short cols)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rows | Number of rows in the new range |
System.Int16 | cols | Number of columns in the new range |
Properties
Address
The address of the inmemory range.
Declaration
public FormulaRangeAddress Address { get; }
Property Value
Type | Description |
---|---|
FormulaRangeAddress |
Current
Declaration
public ICellInfo Current { get; }
Property Value
Type | Description |
---|---|
ICellInfo |
Dimension
The address of the range
Declaration
public FormulaRangeAddress Dimension { get; }
Property Value
Type | Description |
---|---|
FormulaRangeAddress |
Empty
An empty range
Declaration
public static InMemoryRange Empty { get; }
Property Value
Type | Description |
---|---|
InMemoryRange |
IsEmpty
If the range has no cells.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsInMemoryRange
If the range is an inmemory range. Allways true.
Declaration
public bool IsInMemoryRange { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsMulti
If the range is more than one cell.
Declaration
public bool IsMulti { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRef
The in-memory range is never a reference error. Allways false.
Declaration
public bool IsRef { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Size
The size of the range.
Declaration
public RangeDefinition Size { get; }
Property Value
Type | Description |
---|---|
RangeDefinition |
Worksheet
The worksheet.
Declaration
public ExcelWorksheet Worksheet { get; }
Property Value
Type | Description |
---|---|
ExcelWorksheet |
Methods
Dispose()
Declaration
public void Dispose()
GetCell(Int32, Int32)
Declaration
public ICellInfo GetCell(int row, int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | |
System.Int32 | col |
Returns
Type | Description |
---|---|
ICellInfo |
GetEnumerator()
Declaration
public IEnumerator<ICellInfo> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ICellInfo> |
GetNCells()
Get the number of cells in the range
Declaration
public int GetNCells()
Returns
Type | Description |
---|---|
System.Int32 | The number of cells in range. |
GetOffset(Int32, Int32)
Returns the value with the offset from the top-left cell.
Declaration
public object GetOffset(int rowOffset, int colOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowOffset | The row offset from the top-left cell. |
System.Int32 | colOffset | The column offset from the top-left cell. |
Returns
Type | Description |
---|---|
System.Object | The value of the cell |
GetOffset(Int32, Int32, Int32, Int32)
Returns the value with the offset from the top-left cell.
Declaration
public IRangeInfo GetOffset(int rowOffsetStart, int colOffsetStart, int rowOffsetEnd, int colOffsetEnd)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowOffsetStart | The starting row offset from the top-left cell. |
System.Int32 | colOffsetStart | The ending column offset from the top-left cell |
System.Int32 | rowOffsetEnd | The ending row offset from the top-left cell. |
System.Int32 | colOffsetEnd | The starting column offset from the top-left cell. |
Returns
Type | Description |
---|---|
IRangeInfo | The value of the cell |
GetValue(Int32, Int32)
Gets the value of a cell.
Declaration
public object GetValue(int row, int col)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row |
System.Int32 | col | The column |
Returns
Type | Description |
---|---|
System.Object |
IsHidden(Int32, Int32)
If the cell's row is hidden.
Declaration
public bool IsHidden(int rowOffset, int colOffset)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rowOffset | Row offset from the top-left cell |
System.Int32 | colOffset | Column offset from the top-left cell |
Returns
Type | Description |
---|---|
System.Boolean |
MoveNext()
Declaration
public bool MoveNext()
Returns
Type | Description |
---|---|
System.Boolean |
Reset()
Declaration
public void Reset()
SetCell(Int32, Int32, ICellInfo)
Sets the ICellInfo for a cell directly
Declaration
public void SetCell(int row, int col, ICellInfo cell)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row |
System.Int32 | col | The column |
ICellInfo | cell | The cell |
SetValue(Int32, Int32, Object)
Sets the value for a cell.
Declaration
public void SetValue(int row, int col, object val)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | row | The row |
System.Int32 | col | The column |
System.Object | val | The value to set |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
IEnumerator.Current
Declaration
object IEnumerator.Current { get; }
Returns
Type | Description |
---|---|
System.Object |