The target an attribute can apply to. These constants can be bitwise-OR'ed to create a value for multiple targets.// This attribute can target both method and class declaration.
[AttributeType(target = AttributeTarget.METHOD | AttributeTarget.CLASS]
attribute DeclAttribute { }
Parent Class
| Type | Name | Signature |
|---|---|---|
| field S C | CLASS | public static const int CLASS |
| field S C | ATTRIBUTE | public static const int ATTRIBUTE |
| field S C | ENUM | public static const int ENUM |
| field S C | METHOD | public static const int METHOD |
| field S C | FIELD | public static const int FIELD |
| field S C | CONSTRUCTOR | public static const int CONSTRUCTOR |
public static const int CLASSThe attribute may only be applied at a class type declaration. Of particular note, this excludes interface, attribute and enum types.
public static const int ATTRIBUTEThe attribute may only be applied at an attribute type declaration. Such attribute is also known as meta-attribute.
public static const int ENUMThe attribute may only be applied at an enum type declaration.
public static const int METHODThe attribute may only be applied at a method declaration that occurs in either class or interface.
public static const int FIELDThe attribute may only be applied at a field declaration that occurs in either class or attribute.
public static const int CONSTRUCTORThe attribute may only be applied at a constructor declaration that occurs in a class.