Table of Contents

Property ScriptHost

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

ScriptHost

Returns object that implements IScriptHost interface for this runner.

[Browsable(false)]
public virtual IScriptHost ScriptHost { get; set; }

Property Value

IScriptHost

Examples

Here is how to use a ScriptHost in the C# code:

using System;
using Alternet.Common.TypeScript.HostObjects;
using Alternet.Scripter.TypeScript;

public partial class Form1 : Form
{
    private ScriptRun scriptRun;
    private void Form1_Load(object sender, EventArgs e)
    {
        scriptRun = new ScriptRun();
        scriptRun.ScriptHost.HostItemsConfiguration.AddSystemAssemblies(options: HostItemOptions.GlobalMembers | HostItemOptions.GenerateDescriptions);
        scriptRun.ScriptHost.ModulesDirectoryPath = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), "Alternet Scripter for JS Generated Modules");
    }
}

Here is how to use a ScriptHost in the Visual Basic code:

Imports System
Imports Alternet.Common.TypeScript.HostObjects
Imports Alternet.Scripter.TypeScript

Partial Public Class Form1
    Inherits Form

    Private scriptRun As ScriptRun

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        scriptRun = New ScriptRun()
        scriptRun.ScriptHost.HostItemsConfiguration.AddSystemAssemblies(options:=HostItemOptions.GlobalMembers Or HostItemOptions.GenerateDescriptions)
        scriptRun.ScriptHost.ModulesDirectoryPath = Path.Combine(Environment.GetEnvironmentVariable("TEMP"), "Alternet Scripter for JS Generated Modules")
    End Sub
End Class

Remarks

ScriptHost contains properties and methods related to the TypeScript scripts compilation and execution.

Most of the time you don�t need to use ScriptHost directly, as most of its properties and methods are accessible via ScriptRun.