Table of Contents

Class ScriptHost

Namespace
Alternet.Scripter
Assembly
Alternet.Scripter.v9.dll

Provides a base class for script execution. This class is abstract.

public abstract class ScriptHost : IScriptHost, IDisposable
Inheritance
ScriptHost
Implements
Derived

Constructors

ScriptHost(IScriptRun)

Initializes a new instance of ScriptHost with specified script runner.

Properties

AlreadyCompiledAndUpToDate
AssemblyFileName

Gets script assembly file name.

AssemblyPath
AutoGeneratedAssemblyInfo

Gets an auto-generated assembly info code.

AutoGeneratedCode

Gets an auto-generated code.

CertificatePassword

Gets or sets pfx certificate password used to sign an assembly with certificate.

CertificatePath

Gets or sets pfx certificate file path used to sign an assembly with certificate.

CertificateTimeStampURL

Gets or sets a timestamp URL for time-stamping certificate signature.

CompileFailed

Gets or sets boolean value indicating unsuccessful script compilation.

Compiled

Gets boolean value indicating that script has been compiled and ready to be executed.

CompilerErrors

Gets list of compiler errors associated with the script being executed.

ExecutableModulePath

Gets script assembly path.

GenerateExecutable
GenerateModulesOnDisk

Gets or sets value indicating whether script assembly should be written to the disk or kept in memory.

GlobalCode

Gets a global code required for global items.

HostGlobalObject

Gets or sets global type to be used with CSharScript.

ModulesDirectoryPath

Gets or sets path for compiled script assemblies.

Options

Gets or sets options for this script host.

ReuseCompiledModulesFromDisk

Gets or sets boolean value indicating whether to attempt to reuse existing compile results from disk, if up-to-date.

ScriptAssembly

Returns compiled script assembly.

ScriptRun

Gets IScriptRun associated this script host.

StrongKeyPath

Gets a strong key file path used to sign an assembly with a strong key.

Methods

CheckUpToDateCompiledModuleOnDiskAvailable()
Compile(bool, bool, bool)

Initializes script engine and compiles the script.

CopyReferencedAssemblies()

Copies all non-GAC assemblies referenced by a script to the output directories.

CreateReferenceResolver()
DetermineTargetPlatform(ScriptAssemblyKind)

Determines target application platform.

Dispose()

Disposes this ScriptHost and frees resources associated with it.

Dispose(bool)
EvaluateExpression(string)

Evaluates specified expression.

EvaluateExpressionAsync(string, CancellationToken)

Evaluates specified expression asynchronously.

~ScriptHost()

Destroys the instance of the ScriptHost class.

GenerateAssemblyInfo()
GenerateAutoCode()
GenerateGlobalCode(IList<IScriptGlobalItem>)
GetReferencesToCopy()
InternalGetProperty(string, object, object[])
InternalRun(object[])
InternalRunAsync(object[], CancellationToken)
InternalRunMethod(string, object, object[])
InternalRunMethodAsync(string, object, object[], CancellationToken)
InternalRunProcess(object[], bool)
InternalSetProperty(string, object, object)
OnScriptCompiled()
OnScriptError(ScriptErrorEventArgs)
OnScriptRunning()
ReferencesDotNetCoreRuntime(out Version)

Detects a version of the DotNET Core installed on the PC.

Reset()

Removes the script engine from the running state and disconnects automatically bound event handlers.

ResolveReferences()

Returns list of assembly references used by the script.

ResolveReferences(IList<string>)

Returns list of assembly references used by the script.

ResolveReferences(IList<string>, IList<string>)
Run(string[])

Executes script starting from the main entry point.

RunAsync(string[], CancellationToken)

Executes script asynchronously starting from the main entry point.

RunMethod(string, object, object[])

Executes specified method.

RunMethodAsync(string, object, object[], CancellationToken)

Executes specified method asynchronously.

RunProcess(string[], bool)

Executes script starting from the main entry point in standalone process.

SyntaxCheck()

When implemented by a class, performs syntax check of the script.