ToolboxService.GetToolboxItems Method (AssemblyName)

Returns an ICollection of ToolboxItem objects for the given assembly.

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

public static ICollection GetToolboxItems(
	AssemblyName an
)

Parameters

an
Type: System.Reflection.AssemblyName

An assembly name from which to load an assembly.

Return Value

Type: System.Collections.ICollection
A collection containing all the toolbox items in the assembly represented by the given assembly name.

ExceptionCondition
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:

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.

Assemblies loaded in this manner are loaded into a separate AppDomain so they can later be unloaded. This only momentarily locks the assembly file.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft