Discovers the attributes of a property and provides access to property metadata.
Assembly: mscorlib (in mscorlib.dll)
Properties are logically the same as fields. A property is a named aspect of an object's state whose value is typically accessible through get and set accessors. Properties may be read-only, in which case a set routine is not supported.
Several methods in this class assume that the get accessor and set accessor methods of a property have certain formats. The signatures of the get and set methods must match the following convention:
The return type of the get method and the last argument of the set method must be identical. This is the type of the property.
The get and set methods must have the same number, type, and order of indices.
If this format is not followed, the behavior of the GetValue and SetValue methods is undefined.
Calling ICustomAttributeProvider.GetCustomAttributes on PropertyInfo when the inherit parameter of GetCustomAttributes is true does not walk the type hierarchy. Use System.Attribute to inherit custom attributes.Notes to Inheritors:
This example shows how to use various reflection classes to analyze the metadata contained in an assembly.
This example generates about 55,000 lines of data, which you can redirect to a text file at the command prompt, as follows: example.exe > propertyinfo.txt
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC, Xbox 360, Zune
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.