ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
ScriptEngine Class
ScriptEngine Methods
AddCOMObject Method
AddCOMType Method
AddHostObject Method
AddHostType Method
AddHostTypes Method
AddRestrictedHostObject Method
CollectGarbage Method
Dispose Method
Evaluate Method
EvaluateDocument Method
Execute Method
ExecuteCommand Method
ExecuteDocument Method
Finalize Method
GetStackTrace Method
Interrupt Method
Invoke Method

# ScriptEngineAddHostTypes Method

Exposes host types to script code.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public void AddHostTypes(
    	params Type[] types
    )

    Public Sub AddHostTypes (
    	ParamArray types As Type()
    )

    public:
    virtual void AddHostTypes(
    	... array<Type^>^ types
    ) sealed

    abstract AddHostTypes :
            types : Type[] -> unit
    override AddHostTypes :
            types : Type[] -> unit

#### Parameters

types Type
  The types to expose.

#### Implements

IScriptEngineAddHostTypes(Type)
Remarks

This method uses each specified type's name for the new global script item that will represent it.

Host types are exposed to script code in the form of objects whose properties and methods are bound to the type's static members and nested types. If the type has generic parameters, the corresponding object will be invocable with type arguments to yield a specific type.

For more information about the mapping between host members and script-callable properties and methods, see AddHostObject(String, HostItemFlags, Object).

See Also

#### Reference

ScriptEngine Class
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft