System.Reflection.PropertyInfo.GetIndexParameters Method

When overridden in a derived class, returns an array of all the index parameters for the property.

Syntax

public abstract ParameterInfo[] GetIndexParameters ()

Returns

An array of type ParameterInfo containing the parameters for the indexes. If the property is not indexed, the array has 0 (zero) elements.

Exceptions

TypeReason
MethodAccessExceptionThe property reflected by the current instance is visible, but its Get and Set accessors are not, and the caller does not have System.Security.Permissions.ReflectionPermission.

Remarks

Extract any required parameter information from the returned array.

To use the GetIndexParameters method, first get the class Type. From the Type, get the PropertyInfo. From the PropertyInfo, use the GetIndexParameters method.

Permissions

TypeReason
System.Security.Permissions.ReflectionPermissionRequires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0