Attribute class associates predefined system information or user-defined custom information with a target element. A target element can be an assembly, class, constructor, delegate, enum, event, field, interface, method, portable executable file module, parameter, property, return value, struct, or another attribute.
Information provided by an attribute is also known as metadata. Metadata can be examined at run time by your application to control how your program processes data, or before run time by external tools to control how your application itself is processed or maintained. For example, the .NET Framework predefines and uses attribute types to control run-time behavior, and some programming languages use attribute types to represent language features not directly supported by the .NET Framework common type system.
Attribute class. Attributes can be applied to any target element; multiple attributes can be applied to the same target element; and attributes can be inherited by an element derived from a target element. AttributeTargets class to specify the target element to which the attribute is applied.
Attribute class provides convenient methods to retrieve and test custom attributes. Applying Attributes and Extending Metadata Using Attributes.
欢迎光临 纳金网 (http://rs.narkii.com/club/) | Powered by Discuz! X2.5 |