Class ExpressionExtensions
Extension methods for RadExpression that provide convenient value extraction, type conversion, and validation operations for use throughout formula evaluation.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Spreadsheet.Expressions
Assembly: Telerik.Windows.Documents.Spreadsheet.dll
Syntax
public static class ExpressionExtensions
Methods
GetValueAsConstantExpression(RadExpression)
Evaluates the expression and returns its value as a constant, extracting the first element if the result is an array.
Declaration
public static ConstantExpression GetValueAsConstantExpression(this RadExpression expression)
Parameters
|
RadExpression
expression
The expression. |
Returns
|
ConstantExpression
The ConstantExpression result. |
IntegerValue(RadExpression)
Extracts the integer value from a numeric expression, throwing an exception if the expression is not a NumberExpression.
Declaration
public static int IntegerValue(this RadExpression expression)
Parameters
|
RadExpression
expression
The expression. |
Returns
|
System.Int32
The value as integer. |
Exceptions
|
System.ArgumentNullException
Thrown when expression is not NumberExpression. |
IsValidFunctionOrCellReferenceNamePart(Char)
Tests whether a character is valid within a function name or cell reference during formula parsing.
Declaration
public static bool IsValidFunctionOrCellReferenceNamePart(this char character)
Parameters
|
System.Char
character
The character. |
Returns
|
System.Boolean
True if valid, otherwise false. |
NumberValue(RadExpression)
Extracts the numeric value from an expression, returning 0 if the expression is not a NumberExpression.
Declaration
public static double NumberValue(this RadExpression expression)
Parameters
|
RadExpression
expression
The expression. |
Returns
|
System.Double
The number value as double. If the expression is not NumberExpression returns 0. |
ToBooleanExpression(Boolean)
Converts a Boolean value to the corresponding BooleanExpression singleton (True or False).
Declaration
public static BooleanExpression ToBooleanExpression(this bool value)
Parameters
|
System.Boolean
value
The value. |
Returns
|
BooleanExpression
The result as BooleanExpression. |
ToCellRange(CellReferenceRange)
Converts a CellReferenceRange to the equivalent CellRange with resolved row and column indexes.
Declaration
public static CellRange ToCellRange(this CellReferenceRange cellReferenceRange)
Parameters
|
CellReferenceRange
cellReferenceRange
The cell reference range. |
Returns
|
CellRange
The cell range. |