Export (0) Print
Expand All

ToolboxItemContainer Class

Encapsulates a ToolboxItem.

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

[SerializableAttribute]
public class ToolboxItemContainer : ISerializable

ToolboxItemContainer is a simple class that encapsulates a ToolboxItem for efficiency. By having a single class that is always loaded, you can defer the loading of the ToolboxItem until it is needed. Because new classes can be derived from ToolboxItem, you could load a ToolboxItem that could, in turn, load an assembly that is not already in memory. For a large collection of ToolboxItem objects, this could cause a large number of assemblies to be loaded, which decreases performance. Instead, the toolbox service deals only with ToolboxItemContainer objects and retrieves their contained ToolboxItem only when necessary.

The ToolboxItemContainer is designed to hold any cached data from the ToolboxItem. The default implementation only holds the filter of the ToolboxItem, but deriving classes may choose to cache the name, image, and other information. ToolboxItemContainer objects support two forms of serialization: they can be serialized through standard runtime serialization, and they can also load and save themselves from a System.Windows.Forms.IDataObject. The former provides a very easy way to save ToolboxItemContainer objects to a persistent storage. The latter provides a way to integrate ToolboxItemContainer objects with mixed data storage formats.

System.Object
  System.Drawing.Design.ToolboxItemContainer

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft