ExpressionProperty class
Base class which defines an Expression or value for a property.
Constructors
Expression |
Initializes a new instance of the ExpressionProperty class. |
Properties
expression |
Getes or sets the expression text to evaluate to get the value. |
value | Gets or sets the raw value of the expression property. |
Methods
get |
Get the value. |
set |
Set the value. |
to |
This will return the existing expression if the value is non-complex type. |
to |
Convert an expression property to string. |
try |
Try to Get the value. |
Constructor Details
ExpressionProperty(T | string | Expression, T)
Initializes a new instance of the ExpressionProperty class.
new ExpressionProperty(value?: T | string | Expression, defaultValue?: T)
Parameters
- value
-
T | string | Expression
Optional. Raw value of the expression property.
- defaultValue
-
T
Optional. Default value for the property.
Property Details
expressionText
Getes or sets the expression text to evaluate to get the value.
expressionText: string
Property Value
string
value
Gets or sets the raw value of the expression property.
value: T
Property Value
T
Method Details
getValue(object)
Get the value.
function getValue(data: object): T
Parameters
- data
-
object
Data to use for expression binding.
Returns
T
The value.
Remarks
An error will be thrown if value is an invalid expression.
setValue(T | string | Expression)
Set the value.
function setValue(value: T | string | Expression)
Parameters
- value
-
T | string | Expression
Value to set.
toExpression()
This will return the existing expression if the value is non-complex type.
function toExpression(): Expression
Returns
The existing expression if the value is non-complex type.
toString()
Convert an expression property to string.
function toString(): string
Returns
string
The converted string.
tryGetValue(object)
Try to Get the value.
function tryGetValue(data: object): { error: Error, value: T }
Parameters
- data
-
object
Data to use for expression binding.
Returns
{ error: Error, value: T }
the value or an error.