Chapter 13. The System.ComponentModel Namespace

The System.ComponentModel namespace provides many of the classes that support the design-time features of the framework. The key class is Component, which provides a means of encapsulating a class for design-time hosting. IContainer and ISite provide a means to host Component objects and bind them to the design-time environment. Support for custom designers is provided by the System.ComponentModel.Design.IDesigner interface, System.Drawing.Design.UITypeEditor, and custom TypeConverter classes. Figure 13-1 shows many types from this namespace.

There are also a number of classes related to license management.

The designer environment is largely controlled through metadata provided by custom attributes. Classes and properties are adorned with these attributes to indicate how they should appear in the designer host, which custom designers to use, and how they should be serialized. Figure 13-2 shows the attributes in this namespace.

Note that several of the essential classes for the design-time environment can be found in System.ComponentModel.Design, System.Windows.Forms.Design, and System.Drawing.Design.

In addition to the design-time component support, this namespace has become a dumping ground for classes (such as IListSource) that support the data-binding framework, but are not specifically UI related (and hence, are not to be found in the System.Windows.Forms namespace). There are also a couple of refugees from System.Configuration

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.