|
NanoXLSX.Core 3.0.0-rc.3
|
Class representing a cell of a worksheet. More...
Public Types | |
| enum | CellType { String , Number , Date , Time , Bool , Formula , Empty , Default } |
| Enum defines the basic data types of a cell. More... | |
| enum | AddressType { Default , FixedRow , FixedColumn , FixedRowAndColumn } |
| Enum for the referencing style of the address. More... | |
| enum | AddressScope { SingleAddress , Range , Invalid } |
| Enum to define the scope of a passed address string (used in static context). More... | |
Public Member Functions | |
| Cell () | |
| Default constructor. Cells created with this constructor do not have a link to a worksheet initially. | |
| Cell (object value, CellType type) | |
| Constructor with value and cell type. Cells created with this constructor do not have a link to a worksheet initially. | |
| Cell (object value, CellType type, string address) | |
| Constructor with value, cell type and address as string. The worksheet reference is set to null and must be assigned later. | |
| Cell (object value, CellType type, Address address) | |
| Constructor with value, cell type and address as struct. The worksheet reference is set to null and must be assigned later. | |
| Cell (object value, CellType type, int column, int row) | |
| Constructor with value, cell type, row number and column number. | |
| int | CompareTo (Cell other) |
| Implemented CompareTo method. | |
| override bool | Equals (object obj) |
| Compares two objects whether they are addresses and equal. | |
| void | RemoveStyle () |
| Removes the assigned style from the cell. | |
| void | ResolveCellType () |
| Method resets the Cell type and tries to find the actual type. This is used if a Cell was created with the CellType DEFAULT or automatically if a value was set by Value. CellType FORMULA will skip this method and EMPTY will discard the value of the cell. | |
| void | SetCellLockedState (bool isLocked, bool isHidden) |
| Sets the lock state of the cell. | |
| Style | SetStyle (Style style, bool unmanaged=false) |
| Sets the style of the cell. | |
| override int | GetHashCode () |
| Gets the hash code of the cell. | |
Static Public Member Functions | |
| static bool | operator== (Cell left, Cell right) |
| Determines whether two Cell instances are equal. | |
| static bool | operator!= (Cell left, Cell right) |
| Determines whether two Cell instances are not equal. | |
| static bool | operator< (Cell left, Cell right) |
| Determines whether the first instance of a Cell is less/smaller as the second. | |
| static bool | operator<= (Cell left, Cell right) |
| Determines whether the first instance of a Cell is less/smaller or equal as the second. | |
| static bool | operator> (Cell left, Cell right) |
| Determines whether the first instance of a Cell is greater/larger as the second. | |
| static bool | operator>= (Cell left, Cell right) |
| Determines whether the first instance of a Cell is greater/larger or equal as the second. | |
| static IEnumerable< Cell > | ConvertArray< T > (IEnumerable< T > list) |
| Converts a List of supported objects into a list of cells. | |
| static IEnumerable< Address > | GetCellRange (string range) |
| Gets a list of cell addresses from a cell range (format A1:B3 or AAD556:AAD1000). | |
| static IEnumerable< Address > | GetCellRange (string startAddress, string endAddress) |
| Get a list of cell addresses from a cell range. | |
| static IEnumerable< Address > | GetCellRange (int startColumn, int startRow, int endColumn, int endRow) |
| Get a list of cell addresses from a cell range. | |
| static IEnumerable< Address > | GetCellRange (Address startAddress, Address endAddress) |
| Get a list of cell addresses from a cell range. | |
| static string | ResolveCellAddress (int column, int row, AddressType type=AddressType.Default) |
| Gets the address of a cell by the column and row number (zero based). | |
| static Address | ResolveCellCoordinate (string address) |
| Gets the column and row number (zero based) of a cell by the address. | |
| static void | ResolveCellCoordinate (string address, out int column, out int row) |
| Gets the column and row number (zero based) of a cell by the address. | |
| static void | ResolveCellCoordinate (string address, out int column, out int row, out AddressType addressType) |
| Gets the column and row number (zero based) of a cell by the address. | |
| static Range | ResolveCellRange (string range) |
| Resolves a cell range from the format like A1:B3 or AAD556:AAD1000. | |
| static int | ResolveColumn (string columnAddress) |
| Gets the column number from the column address (A - XFD). | |
| static string | ResolveColumnAddress (int columnNumber) |
| Gets the column address (A - XFD). | |
| static AddressScope | GetAddressScope (string addressExpression) |
| Gets the scope of the passed address (string expression). Scope means either single cell address or range. | |
| static void | ValidateColumnNumber (int column) |
| Validates the passed (zero-based) column number. An exception will be thrown if the column is invalid. | |
| static void | ValidateRowNumber (int row) |
| Validates the passed (zero-based) row number. An exception will be thrown if the row is invalid. | |
Properties | |
| string | CellAddress [get, set] |
| Gets or sets the combined cell Address as string in the format A1 - XFD1048576. The address may contain a Cell.AddressType modifier (e.g. C$50). | |
| Address | CellAddress2 [get, set] |
| Gets or sets the combined cell Address as Address object. | |
| Style | CellStyle [get] |
| Gets the assigned style of the cell. | |
| int | ColumnNumber [get, set] |
| Gets or sets the number of the column (zero-based). | |
| CellType | DataType [get, set] |
| Gets or sets the type of the cell. | |
| int | RowNumber [get, set] |
| Gets or sets the number of the row (zero-based). | |
| AddressType | CellAddressType [get, set] |
| Gets or sets the optional address type that can be part of the cell address. | |
| object | Value [get, set] |
| Gets or sets the value of the cell (generic object type). When setting a value, the DataType is automatically resolved. | |
Enum for the referencing style of the address.
| Enumerator | |
|---|---|
| Default | Default behavior (e.g. 'C3'). |
| FixedRow | Row of the address is fixed (e.g. 'C$3'). |
| FixedColumn | Column of the address is fixed (e.g. '$C3'). |
| FixedRowAndColumn | Row and column of the address is fixed (e.g. '$C$3'). |
Enum defines the basic data types of a cell.
| NanoXLSX.Cell.Cell | ( | ) |
| NanoXLSX.Cell.Cell | ( | object | value, |
| CellType | type ) |
Constructor with value and cell type. Cells created with this constructor do not have a link to a worksheet initially.
| value | Value of the cell |
| type | Type of the cell |
| NanoXLSX.Cell.Cell | ( | object | value, |
| CellType | type, | ||
| string | address ) |
Constructor with value, cell type and address as string. The worksheet reference is set to null and must be assigned later.
| value | Value of the cell |
| type | Type of the cell |
| address | Address of the cell |
Constructor with value, cell type and address as struct. The worksheet reference is set to null and must be assigned later.
| value | Value of the cell |
| type | Type of the cell |
| address | Address struct of the cell |
| NanoXLSX.Cell.Cell | ( | object | value, |
| CellType | type, | ||
| int | column, | ||
| int | row ) |
| int NanoXLSX.Cell.CompareTo | ( | Cell | other | ) |
Implemented CompareTo method.
| other | Object to compare |
|
static |
| override bool NanoXLSX.Cell.Equals | ( | object | obj | ) |
|
static |
|
static |
Get a list of cell addresses from a cell range.
| startAddress | Start address |
| endAddress | End address |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if a part of the passed addresses is malformed |
| RangeException | Throws a RangeException if the value of one passed address is out of range (A-XFD and 1 to 1048576) |
|
static |
Get a list of cell addresses from a cell range.
| startColumn | Start column (zero based) |
| startRow | Start row (zero based) |
| endColumn | End column (zero based) |
| endRow | End row (zero based) |
| RangeException | Throws a RangeException if the value of one passed address parts is out of range (A-XFD and 1 to 1048576) |
|
static |
Gets a list of cell addresses from a cell range (format A1:B3 or AAD556:AAD1000).
| range | Range to process |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if a part of the passed range is malformed |
| RangeException | Throws a RangeException if the range is out of range (A-XFD and 1 to 1048576) |
|
static |
Get a list of cell addresses from a cell range.
| startAddress | Start address as string in the format A1 - XFD1048576 |
| endAddress | End address as string in the format A1 - XFD1048576 |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if a part of the passed range is malformed |
| RangeException | Throws a RangeException if the range is out of range (A-XFD and 1 to 1048576) |
| override int NanoXLSX.Cell.GetHashCode | ( | ) |
Determines whether the first instance of a Cell is less/smaller as the second.
true if the left Cell instances is less/smaller; otherwise, false.Determines whether the first instance of a Cell is less/smaller or equal as the second.
true if the left Cell instances is less/smaller, or equal; otherwise, false.Determines whether the first instance of a Cell is greater/larger as the second.
true if the left Cell instances is greater/larger; otherwise, false.Determines whether the first instance of a Cell is greater/larger or equal as the second.
true if the left Cell instances is greater/larger or equal; otherwise, false.| void NanoXLSX.Cell.RemoveStyle | ( | ) |
|
static |
Gets the address of a cell by the column and row number (zero based).
| column | Column number of the cell (zero-based) |
| row | Row number of the cell (zero-based) |
| type | Optional referencing type of the address |
| RangeException | Throws a RangeException if the start or end address was out of range |
|
static |
Gets the column and row number (zero based) of a cell by the address.
| address | Address as string in the format A1 - XFD1048576 |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed address is malformed |
| RangeException | Throws a RangeException if the value of the passed address is out of range (A-XFD and 1 to 1048576) |
|
static |
Gets the column and row number (zero based) of a cell by the address.
| address | Address as string in the format A1 - XFD1048576 |
| column | Column number of the cell (zero-based) as out parameter |
| row | Row number of the cell (zero-based) as out parameter |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the range address was malformed |
| RangeException | Throws a RangeException if the row or column number was out of range |
|
static |
Gets the column and row number (zero based) of a cell by the address.
| address | Address as string in the format A1 - XFD1048576 |
| column | Column number of the cell (zero-based) as out parameter |
| row | Row number of the cell (zero-based) as out parameter |
| addressType | Address type of the cell (if defined as modifiers in the address string) |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the range address was malformed |
| RangeException | Throws a RangeException if the row or column number was out of range |
|
static |
Resolves a cell range from the format like A1:B3 or AAD556:AAD1000.
| range | Range to process |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the start or end address was malformed |
| RangeException | Throws a RangeException if the range is out of range (A-XFD and 1 to 1048576) |
| void NanoXLSX.Cell.ResolveCellType | ( | ) |
|
static |
Gets the column number from the column address (A - XFD).
| columnAddress | Column address (A - XFD) |
| RangeException | Throws a RangeException if the passed address was out of range |
|
static |
Gets the column address (A - XFD).
| columnNumber | Column number (zero-based) |
| RangeException | Throws a RangeException if the passed column number was out of range |
| void NanoXLSX.Cell.SetCellLockedState | ( | bool | isLocked, |
| bool | isHidden ) |
Sets the lock state of the cell.
| isLocked | If true, the cell will be locked if the worksheet is protected |
| isHidden | If true, the value of the cell will be invisible if the worksheet is protected |
| StyleException | Throws a StyleException if the style used to lock cells cannot be referenced |
Sets the style of the cell.
| style | Style to assign |
| unmanaged | Internally used: If true, the style repository is not invoked and only the style object of the cell is updated. Do not use! |
|
static |
Validates the passed (zero-based) column number. An exception will be thrown if the column is invalid.
| column | Number to check |
| RangeException | Thrown if the passed column number is out of range |
|
static |
Validates the passed (zero-based) row number. An exception will be thrown if the row is invalid.
| row | Number to check |
| RangeException | Thrown if the passed row number is out of range |
|
getset |
Gets or sets the combined cell Address as string in the format A1 - XFD1048576. The address may contain a Cell.AddressType modifier (e.g. C$50).
|
getset |
|
getset |
|
get |
|
getset |
Gets or sets the number of the column (zero-based).
| RangeException | Throws a RangeException if the column number is out of range |
|
getset |
|
getset |
Gets or sets the number of the row (zero-based).
| RangeException | Throws a RangeException if the row number is out of range |
|
getset |