ToolboxItem.GetType 方法

定义

创建指定类型的实例。

重载

名称 说明
GetType(IDesignerHost)

允许访问与工具箱项关联的类型。

GetType(IDesignerHost, AssemblyName, String, Boolean)

使用指定的设计器主机和程序集名称(可选)创建指定类型的实例。

GetType(IDesignerHost)

Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
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)

Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
ToolboxItem.cs
Source:
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

另请参阅

适用于