This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
17.1 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 System.Attribute
, 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 (§17.1.3).
By convention, attribute classes are named with a suffix of Attribute
. Uses of an attribute may either include or omit this suffix.