Click or drag to resize

Evaluator Class

Class for evaluating and executing C# based string expressions dynamically at runtime.
Inheritance Hierarchy
SystemObject
  Data.EvalEvaluator

Namespace:  Data.Eval
Assembly:  Data_Eval (in Data_Eval.dll) Version: 2.5.0
Syntax
C#
public sealed class Evaluator

The Evaluator type exposes the following members.

Constructors
  NameDescription
Public methodEvaluator
Creates an instance of the evaluator by specifying the expression to be evaluated.
Top
Properties
  NameDescription
Public propertyDebugFileOutputName
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.
Public propertyItem
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.
Public propertyVariableNames
Returns a list of all the variables that have been added to the Evaluator context.
Top
Methods
  NameDescription
Public methodAddMethod
Allows a method definition to be added to the expression execution context and referenced within the expression.
Public methodAddReference(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.
Public methodAddReference(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.
Public methodAddUsing
Allows namespaces to be added to expression execution context so code within expression does not have to fully qualify classes.
Public methodEval
Executes the expression and returns the resulting value.
Public methodStatic memberEval(String)
Simplified static method to execute an expression and return the resulting value.
Public methodEvalT
Executes the expression and returns the resulting value, cast as the specified object type.
Public methodStatic memberEvalT(String)
Simplified static method to execute an expression and return the resulting value, cast as the specified object type.
Public methodExec
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.
Public methodGetVariable
Returns the value of a variable referenced within the expression after evaluation.
Public methodSetVariable(String, Object)
Sets the value of a variable referenced within the expression prior to evaluation.
Public methodSetVariable(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.
Top
See Also