語言

ToolboxItem.GetType 方法

定義

建立指定型別的實例。

多載

名稱 Description
GetType(IDesignerHost)

可存取與工具箱項目相關的類型。

GetType(IDesignerHost, AssemblyName, String, Boolean)

建立指定型別的實例,並可選擇使用指定的設計主機與組合名稱。

GetType(IDesignerHost)

來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs

可存取與工具箱項目相關的類型。

public:
 Type ^ GetType(System::ComponentModel::Design::IDesignerHost ^ host);
public Type GetType(System.ComponentModel.Design.IDesignerHost host);
public Type? GetType(System.ComponentModel.Design.IDesignerHost? host);
override this.GetType : System.ComponentModel.Design.IDesignerHost -> Type
Public Function GetType (host As IDesignerHost) As Type

參數

host
IDesignerHost

設計主機 來查詢 。ITypeResolutionService

傳回

工具箱物品所對應的類型。

備註

設計主機用於存取介面的實作 ITypeResolutionService 。 然而,載入的型別並未被加入設計主機的參考清單中。

適用於

GetType(IDesignerHost, AssemblyName, String, Boolean)

來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs
來源:
ToolboxItem.cs

建立指定型別的實例,並可選擇使用指定的設計主機與組合名稱。

protected:
 virtual Type ^ GetType(System::ComponentModel::Design::IDesignerHost ^ host, System::Reflection::AssemblyName ^ assemblyName, System::String ^ typeName, bool reference);
protected virtual Type GetType(System.ComponentModel.Design.IDesignerHost host, System.Reflection.AssemblyName assemblyName, string typeName, bool reference);
protected virtual Type? GetType(System.ComponentModel.Design.IDesignerHost? host, System.Reflection.AssemblyName? assemblyName, string typeName, bool reference);
override this.GetType : System.ComponentModel.Design.IDesignerHost * System.Reflection.AssemblyName * string * bool -> Type
Protected Overridable Function GetType (host As IDesignerHost, assemblyName As AssemblyName, typeName As String, reference As Boolean) As Type

參數

host
IDesignerHost

關於 IDesignerHost 目前文件。 這可以是 null。

assemblyName
AssemblyName

表示 AssemblyName 包含要載入型別的組件。 這可以是 null。

typeName
String

要建立實例的類型名稱。

reference
Boolean

一個表示是否要對包含指定型別的組合語言加入參考給設計主機參考集合的值。

傳回

如果能找到指定類型的實例。

例外狀況

未指定 typeName。

另請參閱

適用於