Much of the C# language enables the programmer to specify declarative information about the entities defined in the program. For example, the accessibility of a method in a class is specified by decorating it with the method-modifiers public, protected, internal, and private. C# enables programmers to invent new kinds of declarative information, to specify declarative information for various program entities, and to retrieve attribute information in a run-time environment. For instance, a framework might define a HelpAttribute attribute that can be placed on program elements such as classes and methods to provide a mapping from program elements to documentation for. | Chapter 16 Exceptions 16. Exceptions Copyright Microsoft Corporation 1999-2000. All Rights Reserved. 249 Chapter 17 Attributes 17. Attributes Much of the C language enables the programmer to specify declarative information about the entities defined in the program. For example the accessibility of a method in a class is specified by decorating it with the method-modifiers public protected internal and private. C enables programmers to invent new kinds of declarative information to specify declarative information for various program entities and to retrieve attribute information in a run-time environment. For instance a framework might define a HelpAttribute attribute that can be placed on program elements such as classes and methods to provide a mapping from program elements to documentation for them. New kinds of declarative information are defined through the declaration of attribute classes which may have positional and named parameters . Declarative information is specified a C program using attributes and can be retrieved at run-time as attribute instances . Attribute classes The declaration of an attribute class defines a new kind of attribute that can be placed on a declaration. A class that derives from the abstract class whether directly or indirectly is an attribute class. A declaration of an attribute class is subject to the following additional restrictions A non-abstract attribute class must have public accessibility. All of the types in which a non-abstract attribute class is nested must have public accessibility. A non-abstract attribute class must have at least one public constructor. Each of the formal parameter types for each of the public constructors of an attribute class must be an attribute parameter type . By convention attribute classes are named with a suffix of Attribute. Uses of an attribute may either include or omit this suffix. The AttributeUsage attribute The AttributeUsage .