ReflectorGetIndexedMember(Object, ReflectionWays, Object) Method

Gets the value of an indexable object. It can be either an array instance or an object with default members (indexed properties).

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public static Object? GetIndexedMember(
	Object instance,
	ReflectionWays way,
	params Object?[] indexParameters
)

Parameters

instance  Object
An instance to be read.
way  ReflectionWays
The preferred reflection way. TypeDescriptor way is not applicable here. This parameter is ignored for arrays.
indexParameters  Object
The index parameters.

Return Value

Object
The value returned by the indexable object.

Remarks

This method ignores explicitly implemented interface properties.

If you already have a PropertyInfo instance of the indexed property, then use the GetProperty(Object, PropertyInfo, ReflectionWays, Object) method for better performance.

If way is Auto, then this method uses the DynamicDelegate reflection way.

See Also