ScriptEngineAddHostType Method (String, HostItemFlags, String, String, Type) |
Exposes a host type to script code with the specified options. The type is specified by
type name and assembly name.
Namespace:
Microsoft.ClearScript
Assembly:
ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.3
Syntaxpublic void AddHostType(
string itemName,
HostItemFlags flags,
string typeName,
string assemblyName,
params Type[] typeArgs
)
Public Sub AddHostType (
itemName As String,
flags As HostItemFlags,
typeName As String,
assemblyName As String,
ParamArray typeArgs As Type()
)
public:
void AddHostType(
String^ itemName,
HostItemFlags flags,
String^ typeName,
String^ assemblyName,
... array<Type^>^ typeArgs
)
member AddHostType :
itemName : string *
flags : HostItemFlags *
typeName : string *
assemblyName : string *
typeArgs : Type[] -> unit
Parameters
- itemName
- Type: SystemString
A name for the new global script item that will represent the type. - flags
- Type: Microsoft.ClearScriptHostItemFlags
A value that selects options for the operation. - typeName
- Type: SystemString
The fully qualified name of the type to expose. - assemblyName
- Type: SystemString
The name of the assembly that contains the type to expose. - typeArgs
- Type: SystemType
Optional generic type arguments.
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