Свойство | Тип | Описание | |
---|---|---|---|
DescribeTypeExpressions | bool |
Метод | Описание | |
---|---|---|
Compile ( string input ) : CompiledMethod |
Compiles the input string and returns a delegate that represents the compiled code. Compiles the input string as a C# expression or statement, unlike the Evaluate method, the resulting delegate can be invoked multiple times without incurring in the compilation overhead. This method can only deal with fully formed input strings and does not provide a completion mechanism. If you must deal with partial input (for example for interactive use) use the other overload. On success, a delegate is returned that can be used to invoke the method. |
|
Compile ( string input, CompiledMethod &compiled ) : string |
Compiles the input string and returns a delegate that represents the compiled code. Compiles the input string as a C# expression or statement, unlike the Evaluate method, the resulting delegate can be invoked multiple times without incurring in the compilation overhead. If the return value of this function is null, this indicates that the parsing was complete. If the return value is a string it indicates that the input string was partial and that the invoking code should provide more code before the code can be successfully compiled. If you know that you will always get full expressions or statements and do not care about partial input, you can use the other Compile overload. On success, in addition to returning null, the compiled parameter will be set to the delegate that can be invoked to execute the code. |
|
Evaluate ( string input ) : object |
Evaluates and expression or statement and returns the result. Evaluates the input string as a C# expression or statement and returns the value. This method will throw an exception if there is a syntax error, of if the provided input is not an expression but a statement. |
|
Evaluate ( string input, object &result, bool &result_set ) : string |
Evaluates and expression or statement and returns any result values. Evaluates the input string as a C# expression or statement. If the input string is an expression the result will be stored in the result variable and the result_set variable will be set to true. It is necessary to use the result/result_set pair to identify when a result was set (for example, execution of user-provided input can be an expression, a statement or others, and result_set would only be set if the input was an expression. If the return value of this function is null, this indicates that the parsing was complete. If the return value is a string, it indicates that the input is partial and that the user should provide an updated string. |
|
Evaluator ( |
||
GetCompletions ( string input, string &prefix ) : string[] | ||
GetUsing ( ) : string | ||
GetVars ( ) : string | ||
Init ( ) : void | ||
Interrupt ( ) : void |
Interrupts the evaluation of an expression executing in Evaluate. Use this method to interrupt long-running invocations. |
|
LoadAssembly ( string file ) : void |
Loads the given assembly and exposes the API to the user.
|
|
ReferenceAssembly ( |
Exposes the API of the given assembly to the Evaluator
|
|
Run ( string statement ) : bool |
Executes the given expression or statement. Executes the provided statement, returns true on success, false on parsing errors. Exceptions might be thrown by the called code. |
Метод | Описание | |
---|---|---|
CompileBlock ( |
||
GetUsingList ( ) : ICollection |
||
GetVarNames ( ) : string[] | ||
LookupField ( string name ) : FieldInfo>.Tuple |
||
ParseString ( ParseMode mode, string input, bool &partial_input ) : |
||
Quote ( string s ) : string | ||
Reset ( ) : void | ||
ToplevelOrStatement ( Mono.CSharp.SeekableStreamReader seekable ) : InputKind |
public Compile ( string input ) : CompiledMethod | ||
input | string | |
Результат | CompiledMethod |
public Compile ( string input, CompiledMethod &compiled ) : string | ||
input | string | |
compiled | CompiledMethod | |
Результат | string |
public Evaluate ( string input, object &result, bool &result_set ) : string | ||
input | string | |
result | object | |
result_set | bool | |
Результат | string |
public Evaluator ( |
||
settings | ||
report | ||
Результат | System |
public GetCompletions ( string input, string &prefix ) : string[] | ||
input | string | |
prefix | string | |
Результат | string[] |
public LoadAssembly ( string file ) : void | ||
file | string | |
Результат | void |
public ReferenceAssembly ( |
||
a | ||
Результат | void |