|
NanoXLSX.Core 3.2.1
|
Class representing a defined name within a workbook. A defined name is a descriptive text that represents a cell, a range of cells, a formula, or a constant value, and can be referenced from formulas in worksheets (e.g. =SUM(MyRange)).
More...
Public Types | |
| enum | NameType { Cell , Range , Formula , Constant } |
| Enum to specify the type of the defined name. More... | |
Public Member Functions | |
| bool | Equals (DefinedName other) |
| Determines whether the specified DefinedName instance is equal to the current instance. Two instances are considered equal when their Name, TextValue, Comment, and LocalSheet (compared by reference) match. | |
| override bool | Equals (object obj) |
| Determines whether the specified object is equal to the current instance. | |
| override int | GetHashCode () |
| Returns a hash code consistent with Equals(DefinedName). | |
| int | CompareTo (DefinedName other) |
| Compares this instance with another DefinedName for ordering. The order is determined by Name (ordinal), then by scope (workbook scope sorts before any worksheet-scoped name; for worksheet-scoped names by Worksheet.SheetID), then by TextValue, then by Comment. | |
| override string | ToString () |
| Returns a textual representation of the defined name (intended for debugging). | |
Properties | |
| NameType | Type [get] |
| Type of the defined name. | |
| string | Name [get] |
Gets the name of the defined name as it appears in the workbook (e.g. MyRange). | |
| Worksheet | TargetWorksheet [get] |
| Gets the target worksheet in case of Cell or Range values. For other types, like formulas or constants, the target worksheet is null. | |
| string | TextValue [get] |
Gets the textual reference of the defined name. This is stored verbatim and may be a cell address (e.g. $A$1), a range (e.g. $A$1:$A$10), a formula (e.g. SUM(Sheet1!$A$1:$A$10)), or a constant value. | |
| object | Value [get] |
| Gets the raw reference of the defined Name. The value will be transformed in its appropriate text value (TextValue). If the object is not supported (integer, float, date / date and time, boolean or string), Object.ToString will be used to determine the text value. | |
| Worksheet | LocalSheet [get] |
Gets the worksheet that scopes (constraint) this defined name. If null, the defined name has workbook scope and is visible from any worksheet. If non-null, the defined name is scoped to the referenced worksheet (mapped to the localSheetId attribute on save). | |
| string | Comment [get] |
Gets the optional comment associated with the defined name. Maps to the comment attribute in OOXML. May be null when no comment was set. | |
| FormulaError | Error [get] |
| Gets a possible error of the whole value in a defined name. Default is FormulaError.NoError. | |
| bool | HasExternalReferences [get] |
| Gets whether the value contains a reference or multiple references to an external source (e.g. an external workbook). | |
Class representing a defined name within a workbook. A defined name is a descriptive text that represents a cell, a range of cells, a formula, or a constant value, and can be referenced from formulas in worksheets (e.g. =SUM(MyRange)).
localSheetId attribute in the OOXML representation). The TextValue is stored verbatim — NanoXLSX does not parse or evaluate it. Definition at line 32 of file DefinedName.cs.
Enum to specify the type of the defined name.
| Enumerator | |
|---|---|
| Cell | Defined name is a single cell. |
| Range | Defined name is a cell range. |
| Formula | Defined name is a formula. |
| Constant | Defined name is a constant value. |
Definition at line 38 of file DefinedName.cs.
| int NanoXLSX.DefinedName.CompareTo | ( | DefinedName | other | ) |
Compares this instance with another DefinedName for ordering. The order is determined by Name (ordinal), then by scope (workbook scope sorts before any worksheet-scoped name; for worksheet-scoped names by Worksheet.SheetID), then by TextValue, then by Comment.
| other | Other defined name, or null. A null comparand sorts after this instance. |
Definition at line 479 of file DefinedName.cs.
| bool NanoXLSX.DefinedName.Equals | ( | DefinedName | other | ) |
Determines whether the specified DefinedName instance is equal to the current instance. Two instances are considered equal when their Name, TextValue, Comment, and LocalSheet (compared by reference) match.
| other | Other defined name instance, or null. |
Definition at line 424 of file DefinedName.cs.
| override bool NanoXLSX.DefinedName.Equals | ( | object | obj | ) |
Determines whether the specified object is equal to the current instance.
| obj | Other object, or null. |
Definition at line 447 of file DefinedName.cs.
| override int NanoXLSX.DefinedName.GetHashCode | ( | ) |
Returns a hash code consistent with Equals(DefinedName).
Definition at line 456 of file DefinedName.cs.
| override string NanoXLSX.DefinedName.ToString | ( | ) |
Returns a textual representation of the defined name (intended for debugging).
Definition at line 517 of file DefinedName.cs.
|
get |
Gets the optional comment associated with the defined name. Maps to the comment attribute in OOXML. May be null when no comment was set.
Definition at line 123 of file DefinedName.cs.
|
get |
Gets a possible error of the whole value in a defined name. Default is FormulaError.NoError.
Definition at line 129 of file DefinedName.cs.
|
get |
Gets whether the value contains a reference or multiple references to an external source (e.g. an external workbook).
Definition at line 134 of file DefinedName.cs.
|
get |
Gets the worksheet that scopes (constraint) this defined name. If null, the defined name has workbook scope and is visible from any worksheet. If non-null, the defined name is scoped to the referenced worksheet (mapped to the localSheetId attribute on save).
Definition at line 117 of file DefinedName.cs.
|
get |
Gets the name of the defined name as it appears in the workbook (e.g. MyRange).
Definition at line 91 of file DefinedName.cs.
|
get |
Gets the target worksheet in case of Cell or Range values. For other types, like formulas or constants, the target worksheet is null.
Definition at line 96 of file DefinedName.cs.
|
get |
Gets the textual reference of the defined name. This is stored verbatim and may be a cell address (e.g. $A$1), a range (e.g. $A$1:$A$10), a formula (e.g. SUM(Sheet1!$A$1:$A$10)), or a constant value.
Sheet1) in front of the Reference in case of cells or ranges. The worksheet is automatically added by the defined TargetWorksheetDefinition at line 104 of file DefinedName.cs.
|
get |
Type of the defined name.
Definition at line 86 of file DefinedName.cs.
|
get |
Gets the raw reference of the defined Name. The value will be transformed in its appropriate text value (TextValue). If the object is not supported (integer, float, date / date and time, boolean or string), Object.ToString will be used to determine the text value.
Definition at line 110 of file DefinedName.cs.