![]() | IEvaluator Interface |
Namespace: CSScriptLib
public interface IEvaluator
The IEvaluator type exposes the following members.
Name | Description | |
---|---|---|
![]() | DebugBuild |
Gets or sets a value indicating whether to compile script with debug symbols.
Note, setting DebugBuild will only affect the current instance of Evaluator. If you want to emit debug symbols for all instances of Evaluator then use EvaluatorConfig.DebugBuild. |
![]() | DisableReferencingFromCode |
Gets or sets the flag indicating if the script code should be analyzed and the assemblies
that the script depend on (via '//css_...' and 'using ...' directives) should be referenced.
|
Name | Description | |
---|---|---|
![]() ![]() | Check |
Compiles the specified script text without loading it into the AppDomain or
writing to the file system.
|
![]() ![]() | Clone |
Clones the parent IEvaluator.
This method returns a freshly initialized copy of the IEvaluator. The cloning 'depth' can be controlled by the copyRefAssemblies. This method is a convenient technique when multiple IEvaluator instances are required (e.g. for concurrent script evaluation). |
![]() ![]() | CompileAssemblyFromCode |
Compiles C# code (script) into assembly file. The C# code is a typical C# code containing a single or multiple class definition(s).
|
![]() ![]() | CompileAssemblyFromFile |
Compiles C# file (script) into assembly file. The C# contains typical C# code containing a single or multiple class definition(s).
|
![]() ![]() | CompileCode |
Evaluates (compiles) C# code (script). The C# code is a typical C# code containing a single or multiple class definition(s).
|
![]() ![]() | CompileMethod |
Wraps C# code fragment into auto-generated class (type name DynamicClass) and evaluates it.
This method is a logical equivalent of CompileCode(String, CompileInfo) but is allows you to define your script class by specifying class method instead of whole class declaration. |
![]() ![]() | CreateDelegate(String) |
Wraps C# code fragment into auto-generated class (type name DynamicClass), evaluates it and loads the class to the current AppDomain.
Returns non-typed MethodDelegate for class-less style of invoking. |
![]() ![]() | CreateDelegateT(String) |
Wraps C# code fragment into auto-generated class (type name DynamicClass), evaluates it and loads the class to the current AppDomain.
Returns typed MethodDelegateT for class-less style of invoking. |
![]() | GetReferencedAssemblies |
Returns set of referenced assemblies.
Notre: the set of assemblies is cleared on Reset. |
![]() | GetReferencedAssemblies(String, String) |
Analyses the script code and returns set of locations for the assemblies referenced from the code with CS-Script directives (//css_ref).
|
![]() ![]() | LoadCode(String, Object) |
Evaluates and loads C# code to the current AppDomain. Returns instance of the first class defined in the code.
|
![]() ![]() | LoadCodeT(String, Object) |
Evaluates and loads C# code to the current AppDomain. Returns instance of the first class defined in the code.
|
![]() ![]() | LoadDelegateT |
Wraps C# code fragment into auto-generated class (type name DynamicClass), evaluates it and loads
the class to the current AppDomain.
Returns instance of T delegate for the first method in the auto-generated class. |
![]() ![]() | LoadFile(String, Object) |
Evaluates and loads C# code from the specified file to the current AppDomain. Returns instance of the first
class defined in the script file.
|
![]() ![]() | LoadFileT(String, Object) |
Evaluates and loads C# code from the specified file to the current AppDomain. Returns instance of the first
class defined in the script file.
After initializing the class instance it is aligned to the interface specified by the parameter T.
Note: the script class does not have to inherit from the T parameter as the proxy type will be generated anyway. |
![]() ![]() | LoadMethod(String) |
Wraps C# code fragment into auto-generated class (type name DynamicClass), evaluates it and loads
the class to the current AppDomain.
|
![]() ![]() | LoadMethodT(String) |
Wraps C# code fragment into auto-generated class (type name DynamicClass), evaluates it and loads
the class to the current AppDomain.
After initializing the class instance it is aligned to the interface specified by the parameter T. |
![]() | ReferenceAssembliesFromCode |
References the assemblies from the script code.
The method analyses and tries to resolve CS-Script directives (e.g. '//css_ref') and 'used' namespaces based on the optional search directories. |
![]() | ReferenceAssembly(Assembly) |
References the given assembly.
It is safe to call this method multiple times for the same assembly. If the assembly already referenced it will not be referenced again. |
![]() | ReferenceAssembly(String) |
References the given assembly by the assembly path.
It is safe to call this method multiple times for the same assembly. If the assembly already referenced it will not be referenced again. |
![]() | ReferenceAssemblyByName |
References the name of the assembly by its partial name.
Note that the referenced assembly will be loaded into the host AppDomain in order to resolve assembly partial name. It is an equivalent of Evaluator.ReferenceAssembly(Assembly.LoadWithPartialName(assemblyPartialName)) |
![]() | ReferenceAssemblyByNamespace |
References the assembly by the given namespace it implements.
Adds assembly reference if the namespace was successfully resolved (found) and, otherwise does nothing |
![]() | ReferenceAssemblyOf(Object) |
References the assembly by the object, which belongs to this assembly.
It is safe to call this method multiple times for the same assembly. If the assembly already referenced it will not be referenced again. |
![]() | ReferenceAssemblyOfT |
References the assembly by the object, which belongs to this assembly.
It is safe to call this method multiple times for the same assembly. If the assembly already referenced it will not be referenced again. |
![]() | ReferenceDomainAssemblies |
References the assemblies the are already loaded into the current AppDomain.
|
![]() | Reset |
Resets Evaluator.
Resetting means clearing all referenced assemblies, recreating evaluation infrastructure (e.g. compiler setting) and reconnection to or recreation of the underlying compiling services. Optionally the default current AppDomain assemblies can be referenced automatically with referenceDomainAssemblies. |
![]() | TryReferenceAssemblyByNamespace |
References the assembly by the given namespace it implements.
|