ReflectorGetProperty(Object, PropertyInfo, ReflectionWays, Object) Method

Gets a property represented by the specified PropertyInfo.

Definition

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

Parameters

instance  Object
An instance whose property is about to be retrieved. This parameter is ignored for static properties.
property  PropertyInfo
The property to get.
way  ReflectionWays
The preferred reflection way. TypeDescriptor way is not applicable here.
indexParameters  Object
Index parameters if property is an indexer. This parameter is ignored for non-indexed properties.

Return Value

Object
The value of the property.

Remarks

If way is Auto, then the DynamicDelegate way will be used.

  Note

To get the property explicitly by dynamically created delegates use the PropertyAccessor class.

See Also