BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 System.Enum System.Flags System.Runtime.InteropServices.ComVisible(true)

Enumerates the application elements to which it is valid to attach an attribute.

is used as a parameter for to enable an attribute to be associated with one or more kinds of application elements.

The following example demonstrates how can be used with so that a user-defined attribute class, , can be applied to structures and classes. The attribute is then applied to a class. There is no output.

`using System; [AttributeUsageAttribute(AttributeTargets.Class| AttributeTargets.Struct)] public class Author : Attribute { public Author(string Name) { this.name = Name; } string name; } [Author("John Q Public")] class JohnsClass { public static void Main() { } }`
- Field
  System.AttributeTargets All

  Attribute can be applied to any element.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Assembly

  Attribute can be applied to an assembly.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Class

  Attribute can be applied to a class.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Constructor

  Attribute can be applied to a constructor.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Delegate

  Attribute can be applied to a delegate.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Enum

  Attribute can be applied to an enumeration.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Event

  Attribute can be applied to an event.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Field

  Attribute can be applied to a field.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets

  Attribute can be applied to a generic Parameter.

  2.0.0.0
  4.0.0.0
- Field
  System.AttributeTargets Interface

  Attribute can be applied to an interface.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Method

  Attribute can be applied to a method.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Module

  Attribute can be applied to a module.

  To be added. 1 RuntimeInfrastructure 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Parameter

  Attribute can be applied to a parameter.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Property

  Attribute can be applied to a property.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets ReturnValue

  Attribute can be applied to a return value.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Field
  System.AttributeTargets Struct

  Attribute can be applied to a value type.

  To be added. 0 1.0.5000.0 2.0.0.0 4.0.0.0
0