IComponentDiscoveryService::GetComponentTypes Method (IDesignerHost^, Type^)

 

Gets the list of available component types.

Namespace:   System.ComponentModel.Design
Assembly:  System (in System.dll)

ICollection^ GetComponentTypes(
	IDesignerHost^ designerHost,
	Type^ baseType
)

Parameters

designerHost
Type: System.ComponentModel.Design::IDesignerHost^

The designer host providing design-time services. Can be null.

baseType
Type: System::Type^

The base type specifying the components to retrieve. Can be null.

Return Value

Type: System.Collections::ICollection^

The list of available component types.

The GetComponentTypes method retrieves the list of available component types, which are types implementing the IComponent interface. If the baseType parameter is null, all components are retrieved; otherwise, only component types derived from baseType are returned.

When you pass in a value for the designerHost parameter, type resolution is scoped to designerHost. This means that if there is a ToolboxItem whose type is on disk, and not in the global assembly cache, its type will fail to load through designerHost.

If you pass in null for designerHost, it returns all types that can be queried from the global assembly cache or the Assembly::LoadFrom method.

The following code example demonstrates how to use the GetComponentTypes method to find all the types that derive from the ScrollableControl type.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: