public static Object? InvokeMethod(
Type type,
string methodName,
ReflectionWays way,
params Object?[]? parameters
)
Public Shared Function InvokeMethod (
type As Type,
methodName As String,
way As ReflectionWays,
ParamArray parameters As Object()
) As Object
public:
static Object^ InvokeMethod(
Type^ type,
String^ methodName,
ReflectionWays way,
... array<Object^>^ parameters
)
static member InvokeMethod :
type : Type *
methodName : string *
way : ReflectionWays *
parameters : Object[] -> Object
methodName can refer public and non-public methods. To avoid ambiguity this method gets all of the methods of the same name and chooses the first one for which the provided parameters match.
If you already have a MethodInfo instance use the InvokeMethod(Object, MethodInfo, Type, ReflectionWays, Object) method for better performance.
If you are not sure whether a method with the specified methodName exists, then you can use the TryInvokeMethod methods instead.
If way is Auto, then the DynamicDelegate way will be used.