Table of Contents

Class PropertyInfo

Namespace
System.Reflection
Assembly
mscorlib.dll

Discovers the attributes of a property and provides access to property metadata.

public abstract class PropertyInfo : MemberInfo
Inheritance
PropertyInfo
Inherited Members
Extension Methods

Remarks

Available only in mscorlib build with support for System.Reflection.

Constructors

PropertyInfo()

protected PropertyInfo()

Properties

PropertyType

Gets the type of this property.

public abstract Type PropertyType { get; }

Property Value

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.

public virtual object GetValue(object obj, object[] index)

Parameters

obj object

The object whose property value will be returned.

index object[]

Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties.

Returns

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.

public virtual void SetValue(object obj, object value, object[] index)

Parameters

obj object

The object whose property value will be set.

value object

The new property value.

index object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.