I have a method with this signature, and another method that will be the used as the Action
ProcessFile(Uri uri, Action<Uri> callWhenDone);
void WhenDone(Uri uri);
Now I’m trying to use the Invoke method on MethodInfo (msdn). But parameters is and object array. Which does not accept a ‘method group’.
var methodInfo = myClass.GetType().GetMethod("nameOfMethod");
var methodParams = new object { new Uri(), WhenDone }; //<-- unable to just do this
methodInfo.Invoke(myClass, methodParams);
How do I pass the method group, or a delegate to the method ProcessFile using Invoke or similar?
try this:
or