Evaluator Class |
Namespace: Data.Eval
public sealed class Evaluator
The Evaluator type exposes the following members.
Name | Description | |
---|---|---|
Evaluator |
Creates an instance of the evaluator by specifying the expression
to be evaluated.
|
Name | Description | |
---|---|---|
DebugFileOutputName |
If set, the definition of the internal evaluation class will be saved
out to this file upon the first call to Exec or Eval. This file can be
used to troubleshoot syntax errors.
| |
Item |
Sets the value of a variable referenced within the expression prior
to evaluation or returns the value of a variable referenced within the
expression after evaluation.
| |
VariableNames |
Returns a list of all the variables that have been added to the
Evaluator context.
|
Name | Description | |
---|---|---|
AddMethod |
Allows a method definition to be added to the expression execution
context and referenced within the expression.
| |
AddReference(Assembly) |
Allows methods and types from an external library to be referenced
within an expression by providing a reference to the already
loaded assembly from the calling code.
| |
AddReference(String) |
Allows methods and types from an external library to be referenced
within an expression by providing the path to the location of the
assembly where they're defined.
| |
AddUsing |
Allows namespaces to be added to expression execution context so
code within expression does not have to fully qualify classes.
| |
Eval |
Executes the expression and returns the resulting value.
| |
Eval(String) |
Simplified static method to execute an expression and return the
resulting value.
| |
EvalT |
Executes the expression and returns the resulting value, cast as
the specified object type.
| |
EvalT(String) |
Simplified static method to execute an expression and return the
resulting value, cast as the specified object type.
| |
Exec |
Executes the expression without returning a value. Resulting
new variable values that were updated inside the expression
can be subsequently accessed using GetVariable(String)
or ItemString.
| |
GetVariable |
Returns the value of a variable referenced within the
expression after evaluation.
| |
SetVariable(String, Object) |
Sets the value of a variable referenced within the expression prior
to evaluation.
| |
SetVariable(String, Object, Type) |
Sets the value of a variable referenced within the expression prior
to evaluation. This override allows specifying the Type of the variable
instead of trying to introspect it. Also allows for passing null as the
value.
|