Accessing Attributes With Reflection (C#)
Full Name:
Accessing Attributes With Reflection (C#)
Short Name:
Accessing Attributes With Reflection (C#)
Type of Entity:
C#
Abstract:
The fact that you can define custom attributes and place them in your source code would be of little value without some way of retrieving that information and acting on it. C# has a reflection system that allows you to retrieve the information that was defined with custom attributes. The key method is GetCustomAttributes, which returns an array of objects that are the run-time equivalents of the source code attributes. This method has several overloaded versions. For more information, see Attribute.
MSDN Source URL:
http://msdn2.microsoft.com/z919e8tw.aspx