Table of Contents

Class InMemoryRange

Namespace
OfficeOpenXml.FormulaParsing.Ranges
Assembly
EPPlus.dll

EPPlus implementation of a range that keeps its data in memory

public class InMemoryRange : IRangeInfo, IAddressInfo, IEnumerator<ICellInfo>, IEnumerator, IDisposable, IEnumerable<ICellInfo>, IEnumerable
Inheritance
InMemoryRange
Implements
Inherited Members

Constructors

InMemoryRange(IRangeInfo)

Constructor

public InMemoryRange(IRangeInfo ri)

Parameters

ri IRangeInfo

Another IRangeInfo used as clone for this range. The address of the supplied range will not be copied.

InMemoryRange(FormulaRangeAddress, RangeDefinition)

The constructor

public InMemoryRange(FormulaRangeAddress address, RangeDefinition rangeDef)

Parameters

address FormulaRangeAddress

The worksheet address that should be used for this range. Will be used for implicit intersection.

rangeDef RangeDefinition

Defines the size of the range

InMemoryRange(RangeDefinition)

The constructor

public InMemoryRange(RangeDefinition rangeDef)

Parameters

rangeDef RangeDefinition

Defines the size of the range

InMemoryRange(List<List<object>>)

Constructor

public InMemoryRange(List<List<object>> range)

Parameters

range List<List<object>>

A list of values also defining the size of the range

InMemoryRange(int, short)

Constructor

public InMemoryRange(int rows, short cols)

Parameters

rows int

Number of rows in the new range

cols short

Number of columns in the new range

Properties

Address

The address of the inmemory range.

public FormulaRangeAddress Address { get; }

Property Value

FormulaRangeAddress

Current

Current

public ICellInfo Current { get; }

Property Value

ICellInfo

Dimension

The address of the range

public FormulaRangeAddress Dimension { get; }

Property Value

FormulaRangeAddress

Empty

An empty range

public static InMemoryRange Empty { get; }

Property Value

InMemoryRange

IsEmpty

If the range has no cells.

public bool IsEmpty { get; }

Property Value

bool

IsInMemoryRange

If the range is an inmemory range. Allways true.

public bool IsInMemoryRange { get; }

Property Value

bool

IsMulti

If the range is more than one cell.

public bool IsMulti { get; }

Property Value

bool

IsRef

The in-memory range is never a reference error. Allways false.

public bool IsRef { get; }

Property Value

bool

Size

The size of the range.

public RangeDefinition Size { get; }

Property Value

RangeDefinition

Worksheet

The worksheet.

public ExcelWorksheet Worksheet { get; }

Property Value

ExcelWorksheet

Methods

Dispose()

Dispose

public void Dispose()

GetCell(int, int)

Get cell

public ICellInfo GetCell(int row, int col)

Parameters

row int
col int

Returns

ICellInfo

GetEnumerator()

Get enumerator

public IEnumerator<ICellInfo> GetEnumerator()

Returns

IEnumerator<ICellInfo>

GetNCells()

Get the number of cells in the range

public int GetNCells()

Returns

int

The number of cells in range.

GetOffset(int, int)

Returns the value with the offset from the top-left cell.

public object GetOffset(int rowOffset, int colOffset)

Parameters

rowOffset int

The row offset from the top-left cell.

colOffset int

The column offset from the top-left cell.

Returns

object

The value of the cell

GetOffset(int, int, int, int)

Returns the value with the offset from the top-left cell.

public IRangeInfo GetOffset(int rowOffsetStart, int colOffsetStart, int rowOffsetEnd, int colOffsetEnd)

Parameters

rowOffsetStart int

The starting row offset from the top-left cell.

colOffsetStart int

The ending column offset from the top-left cell

rowOffsetEnd int

The ending row offset from the top-left cell.

colOffsetEnd int

The starting column offset from the top-left cell.

Returns

IRangeInfo

The value of the cell

GetValue(int, int)

Gets the value of a cell.

public object GetValue(int row, int col)

Parameters

row int

The row

col int

The column

Returns

object

IsHidden(int, int)

If the cell's row is hidden.

public bool IsHidden(int rowOffset, int colOffset)

Parameters

rowOffset int

Row offset from the top-left cell

colOffset int

Column offset from the top-left cell

Returns

bool

MoveNext()

Move next

public bool MoveNext()

Returns

bool

Reset()

Reset

public void Reset()

SetCell(int, int, ICellInfo)

Sets the ICellInfo for a cell directly

public void SetCell(int row, int col, ICellInfo cell)

Parameters

row int

The row

col int

The column

cell ICellInfo

The cell

SetValue(int, int, object)

Sets the value for a cell.

public void SetValue(int row, int col, object val)

Parameters

row int

The row

col int

The column

val object

The value to set