Type Summary

						public enum AttributeTargets  {
     All = Assembly | 0x2 | Class | Struct | Enum | Constructor | Method | Property |
           Field | Event | Interface | Parameter | Delegate | ReturnValue,
     Assembly = 0x1,
     Class = 0x4,
     Constructor = 0x20,
     Delegate = 0x1000,
     Enum = 0x10,
     Event = 0x200,
     Field = 0x100,
     Interface = 0x400,
     Method = 0x40,
     Module = 0x2,
     Parameter = 0x800,
     Property = 0x80,
     ReturnValue = 0x2000,
     Struct = 0x8,
}

BA This enum is intended allow members to be combined via the bitwise OR operation such that you can indicate a custom attribute on Classes or Enums; for example:

AttributeTargets.Class | AttributeTargets.Enum

You can recognize enums that were designed for this style of usage by noticing the enum name is plural (AttributeTargets ...

Get .NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.