System Namespace
Base class for custom attributes.
Visibility |
Name |
Value Type |
Accessibility |
public |
TypeId
|
Object |
[ Get ] |
Visibility |
Name |
Parameters |
Return Type |
public |
Equals |
(
Object
obj
)
|
Boolean
|
public static |
GetCustomAttribute |
(
Module
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttribute |
(
MemberInfo
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttribute |
(
Module
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttribute |
(
ParameterInfo
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttribute |
(
ParameterInfo
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttribute |
(
MemberInfo
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttribute |
(
Assembly
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttribute |
(
Assembly
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Module
element
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Module
element
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Assembly
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Assembly
element
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Assembly
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Module
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Assembly
element
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
Module
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttributes |
(
ParameterInfo
element
,
Type
attributeType
)
|
Attribute
|
public static |
GetCustomAttributes |
(
MemberInfo
element
)
|
Attribute
|
public static |
GetCustomAttributes |
(
MemberInfo
element
,
Type
type
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
ParameterInfo
element
)
|
Attribute
|
public static |
GetCustomAttributes |
(
MemberInfo
element
,
Type
type
)
|
Attribute
|
public static |
GetCustomAttributes |
(
MemberInfo
element
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
ParameterInfo
element
,
Type
attributeType
,
Boolean
inherit
)
|
Attribute
|
public static |
GetCustomAttributes |
(
ParameterInfo
element
,
Boolean
inherit
)
|
Attribute
|
public |
GetHashCode |
( )
|
Int32
|
public |
IsDefaultAttribute |
( )
|
Boolean
|
public static |
IsDefined |
(
Assembly
element
,
Type
attributeType
,
Boolean
inherit
)
|
Boolean
|
public static |
IsDefined |
(
ParameterInfo
element
,
Type
attributeType
,
Boolean
inherit
)
|
Boolean
|
public static |
IsDefined |
(
Module
element
,
Type
attributeType
,
Boolean
inherit
)
|
Boolean
|
public static |
IsDefined |
(
Module
element
,
Type
attributeType
)
|
Boolean
|
public static |
IsDefined |
(
ParameterInfo
element
,
Type
attributeType
)
|
Boolean
|
public static |
IsDefined |
(
Assembly
element
,
Type
attributeType
)
|
Boolean
|
public static |
IsDefined |
(
MemberInfo
element
,
Type
attributeType
)
|
Boolean
|
public static |
IsDefined |
(
MemberInfo
element
,
Type
attributeType
,
Boolean
inherit
)
|
Boolean
|
public |
Match |
(
Object
obj
)
|
Boolean
|
|
The Attribute class contains convenience methods to access and test custom attributes. While any user-defined type can be used as an attribute, it is expected that most attributes will be instances of types derived from Attribute.
All attributes derive directly or indirectly from class Attribute. Attributes can be applied to any target element ( see AttributeTargets ); multiple instances of an attribute can be applied to the same target element; and attributes can be inherited by an element derived from a target element. Compilers and other development tools use this information to identify which attributes are custom attributes.
Custom attributes can be stored with any element of the metadata. This mechanism can be used to store application-specific information at compile time and access it either at runtime or when another tool reads the metadata.
.NET Framework predefines some attribute types and uses them to control runtime behavior. Some languages predefine attribute types to represent language features not directly represented in the .NET Framework common type system. Users or other tools are welcome to define and use additional attribute types.
For more information about using attributes, see Extending Metadata Using Attributes.
|
|