ScriptEngineAddHostType(String, String, Type) Method |
Exposes a host type to script code. The type is specified by name.
Namespace: Microsoft.ClearScriptAssembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.4.5
Syntax public void AddHostType(
string itemName,
string typeName,
params Type[] typeArgs
)
Public Sub AddHostType (
itemName As String,
typeName As String,
ParamArray typeArgs As Type()
)
public:
virtual void AddHostType(
String^ itemName,
String^ typeName,
... array<Type^>^ typeArgs
) sealed
abstract AddHostType :
itemName : string *
typeName : string *
typeArgs : Type[] -> unit
override AddHostType :
itemName : string *
typeName : string *
typeArgs : Type[] -> unit
Parameters
- itemName String
- A name for the new global script item that will represent the type.
- typeName String
- The fully qualified name of the type to expose.
- typeArgs Type
- Optional generic type arguments.
Implements
IScriptEngineAddHostType(String, String, Type)Remarks
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