Method InvokeMethodWithResult
InvokeMethodWithResult(Type?, string, object?, object[]?)
Invokes method with object result through the reflection.
public static object? InvokeMethodWithResult(Type? type, string methodName, object? obj = null, object[]? param = null)
Parameters
typeTypeType where to search the method.
methodNamestringMethod name
objobjectObject instance. Optional. Default is null.
paramobject[]Method parameters. Optional. Default is null.
Returns
- object
nullif method not found; otherwise result of the method invoke.
InvokeMethodWithResult(Type?, string, ref MethodInfo?, object?, object[]?, Type[]?)
Invokes method with object result through the reflection.
public static object? InvokeMethodWithResult(Type? type, string methodName, ref MethodInfo? methodInfo, object? obj = null, object[]? param = null, Type[]? paramTypes = null)
Parameters
typeTypeType where to search the method.
methodNamestringMethod name
methodInfoMethodInfoReference to the variable which stores found method. Used in order to speed up the calls. Updated by this function if equals Null.
objobjectObject instance. Optional. Default is null.
paramobject[]Method parameters. Optional. Default is null.
paramTypesType[]Types of prameters. Optional. Default is null.
Returns
- object
nullif method not found; otherwise result of the method invoke.