PropertyAccessorGet(Object, Object) Method

Gets the value of the property with one index parameter. For static properties the instance parameter is omitted (can be ).
See the Remarks section of the Get(Object, Object) overload for details.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public Object? Get(
	Object? instance,
	Object? index
)

Parameters

instance  Object
The instance that the property belongs to. Can be for static properties.
index  Object
The value of the index.

Return Value

Object
The value of the property.

Exceptions

ArgumentNullExceptionThis PropertyAccessor represents an instance property and instance is .
ArgumentExceptionThe type of instance or index is invalid.
-or-
The property cannot be accessed with one index parameter.
InvalidOperationExceptionThe PropertyAccessor represents a property of an open generic type.
NotSupportedExceptionThis PropertyAccessor represents a write-only property.
-or-
On .NET Framework the code is executed in a partially trusted domain with insufficient permissions.
PlatformNotSupportedExceptionYou use the .NET Standard 2.0 build of KGySoft.CoreLibraries and this PropertyAccessor represents a ref property.

See Also