ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
Extensions Class
Extensions Methods
ToHostType Method
ToHostType(Type) Method
ToHostType(Type, ScriptEngine) Method

# ExtensionsToHostType(Type) Method

Converts a type to a host type for use with script code currently running on the calling thread.
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public static Object ToHostType(
    	this Type type
    )

    <ExtensionAttribute>
    Public Shared Function ToHostType (
    	type As Type
    ) As Object

    public:
    [ExtensionAttribute]
    static Object^ ToHostType(
    	Type^ type
    )

    [<ExtensionAttribute>]
    static member ToHostType :
            type : Type -> Object

#### Parameters

type Type
  The type to convert to a host type.

#### Return Value

Object
A host type for use with script code.

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. 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

#### Reference

Extensions Class
ToHostType Overload
Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft