ToolboxService::GetToolboxItems Method (AssemblyName^, Boolean)
Returns an ICollection of ToolboxItem objects for the given assembly.
Assembly: System.Drawing.Design (in System.Drawing.Design.dll)
Parameters
- an
-
Type:
System.Reflection::AssemblyName^
An assembly name from which to load an assembly.
- throwOnError
-
Type:
System::Boolean
true to throw an exception on error; otherwise, false.
Return Value
Type: System.Collections::ICollection^A collection containing all the toolbox items in the assembly represented by the given assembly name.
| Exception | Condition |
|---|---|
| ArgumentNullException | an is null. |
The GetToolboxItems method scans the assembly for all types that support toolbox items, and return items for those types. To support a toolbox item, a type must have the following characteristics:
Be public.
Implement IComponent.
Not be abstract.
Not have a ToolboxItemAttribute set to false on its type.
Not contain generic parameters.
Assemblies are locked for the duration of a process, so enumerating various files through GetToolboxItems can cause many assemblies to be loaded. The GetToolboxItems methods that take an assembly name create a separate AppDomain to search assemblies. When you are finished enumerating ToolboxItem objects for a set of assemblies, you can call the UnloadToolboxItems method, which unloads the AppDomain and frees the file references on the loaded assemblies.
Available since 2.0