ExtensionsToRestrictedHostObjectT(T, ScriptEngine) Method |
Converts an object to a host object with the specified type restriction, for use with
script code running in the specified script engine.
Namespace: Microsoft.ClearScriptAssembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.4.5
Syntax public static Object ToRestrictedHostObject<T>(
this T target,
ScriptEngine engine
)
<ExtensionAttribute>
Public Shared Function ToRestrictedHostObject(Of T) (
target As T,
engine As ScriptEngine
) As Object
public:
[ExtensionAttribute]
generic<typename T>
static Object^ ToRestrictedHostObject(
T target,
ScriptEngine^ engine
)
[<ExtensionAttribute>]
static member ToRestrictedHostObject :
target : 'T *
engine : ScriptEngine -> Object
Parameters
- target T
- The object to convert to a host object for use with script code.
- engine ScriptEngine
- The script engine in which the host object will be used.
Type Parameters
- T
- The type whose members are to be made accessible from script code.
Return Value
ObjectA host object with the specified type restriction.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
T. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also