Redigeeri

Jagamisviis:


ToolboxItem.GetType Method

Definition

Creates an instance of the specified type.

Overloads

GetType(IDesignerHost)

Enables access to the type associated with the toolbox item.

GetType(IDesignerHost, AssemblyName, String, Boolean)

Creates an instance of the specified type, optionally using a specified designer host and assembly name.

GetType(IDesignerHost)

Enables access to the type associated with the toolbox item.

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

Parameters

host
IDesignerHost

The designer host to query for ITypeResolutionService.

Returns

The type associated with the toolbox item.

Remarks

The designer host is used to access an implementation of the ITypeResolutionService interface. However, the loaded type is not added to the list of references in the designer host.

Applies to

GetType(IDesignerHost, AssemblyName, String, Boolean)

Creates an instance of the specified type, optionally using a specified designer host and assembly name.

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

Parameters

host
IDesignerHost

The IDesignerHost for the current document. This can be null.

assemblyName
AssemblyName

An AssemblyName that indicates the assembly that contains the type to load. This can be null.

typeName
String

The name of the type to create an instance of.

reference
Boolean

A value indicating whether or not to add a reference to the assembly that contains the specified type to the designer host's set of references.

Returns

An instance of the specified type, if it can be located.

Exceptions

typeName is not specified.

See also

Applies to