mscorlib 2.0.0.0 4.0.0.0 System.Object System.Runtime.InteropServices.ComVisible(true)

Code that is being examined in the reflection-only context cannot be executed, so it is not always possible to examine custom attributes by creating instances of them and then examining their properties, using methods like , , and so on. If the code for the attribute type itself is loaded into the reflection-only context, it cannot be executed.

The class allows examination of custom attributes in the reflection-only context by providing an abstraction for attributes. The members of this class can be used to obtain the positional arguments and named arguments of the attribute. Use the property to get a list of structures that represent the positional arguments, and use the property to get a list of structures that represent the named arguments.

The structure only provides information about the attribute property used to get and set the argument value. To obtain the type and value of the argument, use the property to obtain a structure.

When you have a structure for an argument, whether named or positional, use the property to get the type and the property to get the value.

For an array argument, the property returns a generic of objects. Each object in the collection represents the corresponding element of the array.

can be used in the execution context as well as in the reflection-only context. For example, you might want to avoid loading the assembly that contains the code for a custom attribute. Using the class is different from using methods like :

The properties and methods of only provide you with the values that were specified for the attribute instance, not the semantics of the constructor. For example, a string argument of an attribute might be converted internally to some other representation, and returned in a canonical form; or a property might have side effects when the actual attribute code is executed.

The properties and methods of do not allow you to retrieve the custom attributes inherited from base classes.

To create instances of the class, use the static (Shared in Visual Basic) factory methods.

Provides access to custom attribute data for assemblies, modules, types, members and parameters that are loaded into the reflection-only context.

- Constructor
  4.0.0.0

  This constructor is invoked by derived classes during the construction of objects.

  Initializes a new instance of the class.

- Property
  4.0.0.0
  System.Type To be added. To be added.

  Gets the type of the attribute.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Reflection.ConstructorInfo To be added.

  If an attribute type has multiple constructors, this property returns only the particular constructor that would have initialized the attribute instance represented by the current object.

  Gets a object that represents the constructor that would have initialized the custom attribute.

- Property
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(true)
  System.Collections.Generic.IList<System.Reflection.CustomAttributeTypedArgument> To be added.

  This method gets the positional arguments that were specified for the custom attribute instance without executing any of the custom attribute code. Thus, it can be used in the reflection-only context.

  Use the method to get the named arguments specified for the attribute instance.

  Gets the list of positional arguments specified for the attribute instance represented by the object.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  Returns a value that indicates whether this instance is equal to a specified object.

  true if is equal to the current instance; otherwise, false.

  An object to compare with this instance, or null.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<System.Reflection.CustomAttributeData> ``

  This method provides an alternative to the method that can always be used in the Reflection-only context.

  Returns a list of objects representing data about the attributes that have been applied to the target assembly.

  A list of objects that represent data about the attributes that have been applied to the target assembly.

  The assembly whose custom attribute data is to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<System.Reflection.CustomAttributeData> ``

  This method overload gets custom attribute data for types, nested types, and type members, because the class and the classes in the namespace that represent type members all derive from .

  Returns a list of objects representing data about the attributes that have been applied to the target member.

  A list of objects that represent data about the attributes that have been applied to the target member.

  The member whose attribute data is to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<System.Reflection.CustomAttributeData> `` To be added.

  Returns a list of objects representing data about the attributes that have been applied to the target module.

  A list of objects that represent data about the attributes that have been applied to the target module.

  The module whose custom attribute data is to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<System.Reflection.CustomAttributeData> ``

  This method provides an alternative to the method that can always be used in the Reflection-only context.

  Returns a list of objects representing data about the attributes that have been applied to the target parameter.

  A list of objects that represent data about the attributes that have been applied to the target parameter.

  The parameter whose attribute data is to be retrieved.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<System.Reflection.CustomAttributeNamedArgument> To be added.

  This method gets the named arguments that were specified for the custom attribute instance without executing any of the custom attribute code. Thus, it can be used in the Reflection-only context.

  The list that is returned contains only the named arguments that were specified for the attribute instance.

  Use the method to get the positional arguments that were specified for the attribute instance.

  Gets the list of named arguments specified for the attribute instance represented by the object.

- Method
  2.0.0.0
  4.0.0.0
  System.String

  The string value includes the attribute type, the attribute parameters, and the named parameters.

  Returns a string representation of the custom attribute.

  A string value that represents the custom attribute.