Class PropertyInfo
Discovers the attributes of a property and provides access to property metadata.
Inherited Members
Namespace: System.Reflection
Assembly: mscorlib.dll
Syntax
public abstract class PropertyInfo : MemberInfo
Remarks
Available only in mscorlib build with support for System.Reflection.
Constructors
PropertyInfo()
Declaration
protected PropertyInfo()
Properties
PropertyType
Gets the type of this property.
Declaration
public abstract Type PropertyType { get; }
Property Value
Type | Description |
---|---|
Type | The type of this property. |
Methods
GetValue(object, object[])
Returns the property value of a specified object with optional index values for indexed properties.
Declaration
public virtual object GetValue(object obj, object[] index)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object whose property value will be returned. |
object[] | index | Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties. |
Returns
Type | Description |
---|---|
object | The property value of the specified object. |
SetValue(object, object, object[])
Sets the property value of a specified object with optional index values for index properties.
Declaration
public virtual void SetValue(object obj, object value, object[] index)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object whose property value will be set. |
object | value | The new property value. |
object[] | index | Optional index values for indexed properties. This value should be null for non-indexed properties. |