New to the .NET framework is the concept of attribute-based development. Attributes provide an extensibility mechanism for classes, properties, methods, parameters, and return values. By applying attributes to a particular entity, the default behavior can be altered to produce a new desired result. For a complete description of attributes, refer to the MSDN help.
The .NET designer architecture makes heavy use of attributes to simplify common development tasks. Examples include defining the default value for a property, assigning a category and description to properties, and indicating the default event for a control, to name a few. No discussion of the designer architecture would be complete without a list of attributes commonly used for designers, controls, serialization, licensing, and the PropertyGrid. Table 5.12 lists the attributes found in the System.ComponentModel namespace, along with descriptions.
Table 5.13 and Table 5.14 list the attributes found in the System.ComponentModel.Design.Serialization and System.Drawing namespaces, respectively.
Attribute | Description |
---|---|
ToolboxBitmapAttribute | Associates an image with the specified component. Support for small and large images. |
Attributes are a prominent theme in .NET development, and custom control development is no exception.
18.119.133.228