Search Results for

    Show / Hide Table of Contents

    Class DlrScriptScope

    Represents a scope for the dlr hosting system. A scope descriptes an area, where stuff is available and accessable

    Inheritance
    System.Object
    DlrScriptScope
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Dlr
    Assembly: Simplic.Dlr.dll
    Syntax
    public class DlrScriptScope

    Constructors

    | Improve this Doc View Source

    DlrScriptScope(IDlrHost)

    Create new DlrScope for executing base stuff

    Declaration
    public DlrScriptScope(IDlrHost host)
    Parameters
    Type Name Description
    IDlrHost host

    Instance of the hosting component

    Properties

    | Improve this Doc View Source

    DynamicScriptScope

    Get current dnymic script scope

    Declaration
    public dynamic DynamicScriptScope { get; }
    Property Value
    Type Description
    System.Object
    | Improve this Doc View Source

    Host

    Instance of the connected host

    Declaration
    public IDlrHost Host { get; }
    Property Value
    Type Description
    IDlrHost
    | Improve this Doc View Source

    ScriptScope

    Instance of the dlr script scope

    Declaration
    public ScriptScope ScriptScope { get; }
    Property Value
    Type Description
    ScriptScope

    Methods

    | Improve this Doc View Source

    CallFunction(String, Object[])

    Call a function within the current scope

    Declaration
    public dynamic CallFunction(string name, params object[] parameter)
    Parameters
    Type Name Description
    System.String name

    Name of the function

    System.Object[] parameter

    List of parameter

    Returns
    Type Description
    System.Object

    Return value of the function

    | Improve this Doc View Source

    ClearCache()

    Clear cached expressions

    Declaration
    public void ClearCache()
    | Improve this Doc View Source

    CreateClassInstance(String, Object[])

    Create an instance of an IronPython class

    Declaration
    public DlrClass CreateClassInstance(string className, params object[] parameter)
    Parameters
    Type Name Description
    System.String className

    Name of the class

    System.Object[] parameter

    List of parameter which will be passed to the constructor

    Returns
    Type Description
    DlrClass

    Instance of a dlr class containing dlr meta class

    | Improve this Doc View Source

    Execute(String, Boolean)

    Execute a simple script expression

    Declaration
    public dynamic Execute(string expression, bool cache = true)
    Parameters
    Type Name Description
    System.String expression

    Script expression as a string

    System.Boolean cache

    True if the expression should be cached

    Returns
    Type Description
    System.Object

    Result of the script expression as dynamic

    | Improve this Doc View Source

    ExecutePreCompiledCode(String, ScriptScope)

    Execute precompiled code and return result

    Declaration
    public dynamic ExecutePreCompiledCode(string name, ScriptScope otherScope = null)
    Parameters
    Type Name Description
    System.String name

    Unique name of the scipt

    ScriptScope otherScope

    Deriving scope in which the script should be executed in

    Returns
    Type Description
    System.Object

    Result of the script/statement

    | Improve this Doc View Source

    ExecuteScript(String, Boolean)

    Execute a script. The script will be searched in all resolvers and the default search paths

    Declaration
    public dynamic ExecuteScript(string path, bool alwaysExecute = false)
    Parameters
    Type Name Description
    System.String path

    Script path

    System.Boolean alwaysExecute

    If set to true, the script will be executed event if it was before. If set to false and the path was already executed, null will be returned

    Returns
    Type Description
    System.Object

    Result of the script execution

    | Improve this Doc View Source

    GetVariable(String)

    Get variable value by name

    Declaration
    public dynamic GetVariable(string variable)
    Parameters
    Type Name Description
    System.String variable

    Name of the variable

    Returns
    Type Description
    System.Object

    Content of the variable

    | Improve this Doc View Source

    IsScriptPathCached(String)

    Returns whether a script was executed over ExecuteScript

    Declaration
    public bool IsScriptPathCached(string path)
    Parameters
    Type Name Description
    System.String path

    Path to the script

    Returns
    Type Description
    System.Boolean

    True if the script was executed

    | Improve this Doc View Source

    PreCompileCode(String, String, Boolean, Boolean)

    Precompile code and store it in a dictioanry

    Declaration
    public void PreCompileCode(string name, string code, bool overrideExisting = true, bool isModule = false)
    Parameters
    Type Name Description
    System.String name

    Unique name of the script, to access it later

    System.String code

    Code to compile

    System.Boolean overrideExisting

    True if existing scripts with the same name can be overriden. If set to false and the script alredy exists, an exception will be thrown

    System.Boolean isModule

    Register also as module, so it can be load with the import command. !!!Not yet implemented!!!

    | Improve this Doc View Source

    RemoveCachedScriptPath(String)

    Remove path from cache, so that a script from ExecuteScript will be executed the next time without using alwaysExecute = true

    Declaration
    public void RemoveCachedScriptPath(string path)
    Parameters
    Type Name Description
    System.String path

    Path to the script

    | Improve this Doc View Source

    SetVariable(String, Object)

    Set the value of a variable in the current scope

    Declaration
    public void SetVariable(string variable, dynamic value)
    Parameters
    Type Name Description
    System.String variable

    Name of the variable

    System.Object value

    Value of the variable

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx