C# Класс LeopotamGroup.Scripting.ScriptVM

Script engine VM. Internal class.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CallFunction ( string funcName, ScriptVar &result, ScriptVar param1 = null, ScriptVar param2 = null, ScriptVar param3 = null, ScriptVar param4 = null ) : string

Call script function.

GetParamByID ( int id ) : ScriptVar

Get specified parameter that was passed from script to current host function.

GetParamsCount ( ) : int

Get parameters count passed from script to current host function.

IsFunctionExists ( string funcName ) : bool

Is script function exists.

Load ( string source ) : string

Load script source code. Old Vm state will be reset.

RegisterHostFunction ( string funcName, HostFunction cb ) : void

Register host function to VM (publish to calling from script side).

ScriptVM ( ) : LeopotamGroup.Scripting.Internal

Default initialization.

SetRuntimeError ( string msg ) : void

Raise runtime error at VM.

UnregisterAllHostFunctions ( ) : void

Unregister all host functions from VM (unpublish from script side).

Описание методов

CallFunction() публичный Метод

Call script function.
public CallFunction ( string funcName, ScriptVar &result, ScriptVar param1 = null, ScriptVar param2 = null, ScriptVar param3 = null, ScriptVar param4 = null ) : string
funcName string Function name.
result ScriptVar Result of function execution.
param1 ScriptVar Optional parameter to function.
param2 ScriptVar Optional parameter to function.
param3 ScriptVar Optional parameter to function.
param4 ScriptVar Optional parameter to function.
Результат string

GetParamByID() публичный Метод

Get specified parameter that was passed from script to current host function.
public GetParamByID ( int id ) : ScriptVar
id int Number of parameter.
Результат ScriptVar

GetParamsCount() публичный Метод

Get parameters count passed from script to current host function.
public GetParamsCount ( ) : int
Результат int

IsFunctionExists() публичный Метод

Is script function exists.
public IsFunctionExists ( string funcName ) : bool
funcName string Function name.
Результат bool

Load() публичный Метод

Load script source code. Old Vm state will be reset.
public Load ( string source ) : string
source string Source.
Результат string

RegisterHostFunction() публичный Метод

Register host function to VM (publish to calling from script side).
public RegisterHostFunction ( string funcName, HostFunction cb ) : void
funcName string Func name.
cb HostFunction Cb.
Результат void

ScriptVM() публичный Метод

Default initialization.
public ScriptVM ( ) : LeopotamGroup.Scripting.Internal
Результат LeopotamGroup.Scripting.Internal

SetRuntimeError() публичный Метод

Raise runtime error at VM.
public SetRuntimeError ( string msg ) : void
msg string Message.
Результат void

UnregisterAllHostFunctions() публичный Метод

Unregister all host functions from VM (unpublish from script side).
public UnregisterAllHostFunctions ( ) : void
Результат void