System.AttributeTargets
is an enum that lists the language elements on which an attribute (a class that derives from System.Attribute
inherits) can be applied. Language element to which attribute can be applied | ||
All | 32767 | any application element |
Assembly | 1 | an assembly |
Class | 4 | a class. |
Constructor | 32 | a constructor |
Delegate | 4096 | a delegate |
Enum | 16 | an enumeration |
Event | 512 | an event |
Field | 256 | a field |
GenericParameter | 16384 | a generic parameter. Currently, this attribute can be applied only in C#, Microsoft intermediate language (MSIL), and emitted code. |
Interface | 1024 | an interface. |
Method | 64 | a method. |
Module | 2 | a module. Module refers to a portable executable file (DLL or executable), not a Visual Basic standard module. |
Parameter | 2048 | a parameter |
Property | 128 | a property |
ReturnValue | 8192 | a return value |
Struct | 8 | a structure (i.e. a value type) |