MethodAccessorInvoke(Object, Object, Object, Object, Object) Method

Invokes the method with four parameters. The return value of void methods is always . For static methods the instance parameter is omitted (can be ).
See the Remarks section of the Invoke(Object, Object) overload for details.

Definition

Namespace: KGySoft.Reflection
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public Object? Invoke(
	Object? instance,
	Object? param1,
	Object? param2,
	Object? param3,
	Object? param4
)

Parameters

instance  Object
The instance that the method belongs to. Can be for static methods.
param1  Object
The value of the first parameter.
param2  Object
The value of the second parameter.
param3  Object
The value of the third parameter.
param4  Object
The value of the fourth parameter.

Return Value

Object
The return value of the method, or for void methods.

Exceptions

ArgumentNullExceptionThis MethodAccessor represents an instance method and instance is .
ArgumentExceptionThe type of instance or a specified parameter is invalid.
-or-
The method cannot be invoked with four parameters.
InvalidOperationExceptionThis MethodAccessor represents an open generic method or a method of an open generic type.
NotSupportedExceptionOn .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 MethodAccessor represents a ref-returning method.

See Also