IScriptEngineAddHostType(HostItemFlags, Type) Method |
Exposes a host type to script code with a default name and the specified options.
Namespace: Microsoft.ClearScriptAssembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.4.5
Syntax void AddHostType(
HostItemFlags flags,
Type type
)
Sub AddHostType (
flags As HostItemFlags,
type As Type
)
void AddHostType(
HostItemFlags flags,
Type^ type
)
abstract AddHostType :
flags : HostItemFlags *
type : Type -> unit
Parameters
- flags HostItemFlags
- A value that selects options for the operation.
- type Type
- The type to expose.
Remarks
This method uses 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