Show / Hide Table of Contents

Class InMemoryRange

EPPlus implementation of a range that keeps its data in memory

Inheritance
object
InMemoryRange
Implements
IRangeInfo
IAddressInfo
IEnumerator<ICellInfo>
IEnumerator
IDisposable
IEnumerable<ICellInfo>
IEnumerable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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
List<List<object>> range

A list of values also defining the size of the range

InMemoryRange(int, short)

Constructor

Declaration
public InMemoryRange(int rows, short cols)
Parameters
Type Name Description
int rows

Number of rows in the new range

short 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

Addresses

The addresses for the range, if more than one.

Declaration
public FormulaRangeAddress[] Addresses { get; }
Property Value
Type Description
FormulaRangeAddress[]

Current

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
bool

IsInMemoryRange

If the range is an inmemory range. Allways true.

Declaration
public bool IsInMemoryRange { get; }
Property Value
Type Description
bool

IsMulti

If the range is more than one cell.

Declaration
public bool IsMulti { get; }
Property Value
Type Description
bool

IsRef

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

Declaration
public bool IsRef { get; }
Property Value
Type Description
bool

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()

Dispose

Declaration
public void Dispose()

GetAddressDimensionAdjusted(int)

Get the address adjusted inside the dimension of the worksheet. Not applicable on InMemoryRange's, as no addresses us used.

Declaration
public FormulaRangeAddress GetAddressDimensionAdjusted(int index)
Parameters
Type Name Description
int index

Not applicable on InMemoryRange's.

Returns
Type Description
FormulaRangeAddress

The address.

GetCell(int, int)

Get cell

Declaration
public ICellInfo GetCell(int row, int col)
Parameters
Type Name Description
int row
int col
Returns
Type Description
ICellInfo

GetEnumerator()

Get enumerator

Declaration
public IEnumerator<ICellInfo> GetEnumerator()
Returns
Type Description
IEnumerator<ICellInfo>

GetNCells()

Get the number of cells in the range

Declaration
public int GetNCells()
Returns
Type Description
int

The number of cells in range.

GetOffset(int, int)

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

Declaration
public object GetOffset(int rowOffset, int colOffset)
Parameters
Type Name Description
int rowOffset

The row offset from the top-left cell.

int colOffset

The column offset from the top-left cell.

Returns
Type Description
object

The value of the cell

GetOffset(int, int, int, int)

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
int rowOffsetStart

The starting row offset from the top-left cell.

int colOffsetStart

The ending column offset from the top-left cell

int rowOffsetEnd

The ending row offset from the top-left cell.

int colOffsetEnd

The starting column offset from the top-left cell.

Returns
Type Description
IRangeInfo

The value of the cell

GetRangeInfoByValue()

Gets the IRangeInfo for the range for the first and last value in the range (top-left to bottom-right)

Declaration
public IRangeInfo GetRangeInfoByValue()
Returns
Type Description
IRangeInfo

The range

GetValue(int, int)

Gets the value of a cell.

Declaration
public object GetValue(int row, int col)
Parameters
Type Name Description
int row

The row

int col

The column

Returns
Type Description
object

IsHidden(int, int)

If the cell's row is hidden.

Declaration
public bool IsHidden(int rowOffset, int colOffset)
Parameters
Type Name Description
int rowOffset

Row offset from the top-left cell

int colOffset

Column offset from the top-left cell

Returns
Type Description
bool

MoveNext()

Move next

Declaration
public bool MoveNext()
Returns
Type Description
bool

Reset()

Reset

Declaration
public void Reset()

SetCell(int, int, ICellInfo)

Sets the ICellInfo for a cell directly

Declaration
public void SetCell(int row, int col, ICellInfo cell)
Parameters
Type Name Description
int row

The row

int col

The column

ICellInfo cell

The cell

SetValue(int, int, object)

Sets the value for a cell.

Declaration
public void SetValue(int row, int col, object val)
Parameters
Type Name Description
int row

The row

int col

The column

object val

The value to set

Implements

IRangeInfo
IAddressInfo
IEnumerator<T>
IEnumerator
IDisposable
IEnumerable<T>
IEnumerable
In this article
Back to top Generated by DocFX