ClassExpressionExtensions
Extension methods for RadExpression that provide convenient value extraction, type conversion, and validation operations for use throughout formula evaluation.
Definition
Namespace:Telerik.Windows.Documents.Spreadsheet.Expressions
Assembly:Telerik.Windows.Documents.Spreadsheet.dll
Syntax:
public static class ExpressionExtensions
Inheritance: objectExpressionExtensions
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
expression
The expression.
Returns
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
expression
The expression.
Returns
The value as integer.
Exceptions
Thrown when expression is not NumberExpression.
IsValidFunctionOrCellReferenceNamePart(char)
Tests whether a character is valid within a function name or cell reference during formula parsing.
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
expression
The expression.
Returns
The number value as double. If the expression is not NumberExpression returns 0.
ToBooleanExpression(bool)
Converts a Boolean value to the corresponding BooleanExpression singleton (True or False).
Declaration
public static BooleanExpression ToBooleanExpression(this bool value)
Parameters
value
The value.
Returns
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
The cell reference range.
Returns
The cell range.