ScriptEngineAddRestrictedHostObjectT Method (String, T) |
Exposes a host object to script code with the specified type restriction.
Namespace:
Microsoft.ClearScript
Assembly:
ClearScript.Core (in ClearScript.Core.dll) Version: 7.2.4
Syntaxpublic void AddRestrictedHostObject<T>(
string itemName,
T target
)
Public Sub AddRestrictedHostObject(Of T) (
itemName As String,
target As T
)
public:
generic<typename T>
void AddRestrictedHostObject(
String^ itemName,
T target
)
member AddRestrictedHostObject :
itemName : string *
target : 'T -> unit
Parameters
- itemName
- Type: SystemString
A name for the new global script item that will represent the object. - target
- Type: T
The object to expose.
Type Parameters
- T
- The type whose members are to be made accessible from script code.
Remarks
This method can be used to restrict script access to the members of a particular
interface or base class.
For information about the mapping between host members and script-callable properties
and methods, see AddHostObject(String, HostItemFlags, Object).
See Also