Tip
To preserve the changes of a mutable value type embed it into a variable of Object type and pass it to the instance parameter of this method.
public static Object? InvokeMethod(
Object? instance,
MethodInfo method,
params Object?[]? parameters
)
Public Shared Function InvokeMethod (
instance As Object,
method As MethodInfo,
ParamArray parameters As Object()
) As Object
public:
static Object^ InvokeMethod(
Object^ instance,
MethodInfo^ method,
... array<Object^>^ parameters
)
static member InvokeMethod :
instance : Object *
method : MethodInfo *
parameters : Object[] -> Object
For invoking the method this method uses the DynamicDelegate reflection way, except when the .NET Standard 2.0 version of the KGySoft.CoreLibraries assembly is referenced and the method is an instance member of a value type (struct) or has ref/out parameters, in which case the SystemReflection way will be used.