ExpressionExtensions
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
Evaluates the expression and returns its value as a constant, extracting the first element if the result is an array.
public static ConstantExpression GetValueAsConstantExpression(this RadExpression expression)
The expression.
Returns:The ConstantExpression result.
Extracts the integer value from a numeric expression, throwing an exception if the expression is not a NumberExpression.
public static int IntegerValue(this RadExpression expression)
The expression.
Returns:The value as integer.
Exceptions:Thrown when expression is not NumberExpression.
Extracts the numeric value from an expression, returning 0 if the expression is not a NumberExpression.
public static double NumberValue(this RadExpression expression)
The expression.
Returns:The number value as double. If the expression is not NumberExpression returns 0.
Converts a Boolean value to the corresponding BooleanExpression singleton (True or False).
public static BooleanExpression ToBooleanExpression(this bool value)
The value.
Returns:The result as BooleanExpression.
Converts a CellReferenceRange to the equivalent CellRange with resolved row and column indexes.
public static CellRange ToCellRange(this CellReferenceRange cellReferenceRange)
The cell reference range.
Returns:The cell range.