[]
Contains options for converting a FormulaSyntaxTree to a formula string.
Use this context to control how ToString(UnParseContext) formats references when converting a syntax tree back to text. The context can specify the formula position through 0-based base row and base column values, whether references are formatted in R1C1 style, and the culture used during conversion.
A new instance is empty and uses the invariant culture by default.
public class UnParseContext
Public Class UnParseContext
FormulaSyntaxTree syntaxTree = FormulaSyntaxTree.Parse("OR(A1={1,3,5})");
FunctionNode functionNode = (FunctionNode)syntaxTree.Root;
OperatorNode operatorNode = (OperatorNode)functionNode.Children[0];
ArrayNode arrayNode = (ArrayNode)operatorNode.Children[1];
object[,] elements = arrayNode.Elements;
elements[0, 0] = 5;
elements[0, 1] = 6;
elements[0, 2] = 7;
UnParseContext context = new UnParseContext();
context.IsR1C1 = true;
string formulaText = syntaxTree.ToString(context);
| Name | Description |
|---|---|
| UnParseContext() | Creates an empty UnParseContext. |
| Name | Description |
|---|---|
| BaseColumn | Gets or sets the 0-based column location of the formula. This value is used by UnParseContext when converting a FormulaSyntaxTree to formula text, especially for references whose text depends on the formula position, such as R1C1-style references. |
| BaseRow | Gets or sets the 0-based row location of the formula. This value identifies the base row used by UnParseContext when converting a FormulaSyntaxTree back to formula text. It is typically used together with BaseColumn for references whose text depends on the formula location, such as R1C1-style references. |
| IsR1C1 | Indicates whether the reference style is R1C1. |