G
Guest
I know how to use Reflection to instantiate a class from an assembly and then
call it via InvokeMember. But now I need to use that method as an argument
to pass into an internal routine I have that saves the method reference as a
delegate. In non-Reflection code I'd do this:
public delegate void myHandler(string arg);
public void myMethod(myHandler mh) {...}
public void myCustomHandler(string arg) {...}
public void setup()
{
myMethod(this.MyCustomHandler);
}
So what I'd like to do instead is sort of call "myMethod(reflectionMethod)";
call it via InvokeMember. But now I need to use that method as an argument
to pass into an internal routine I have that saves the method reference as a
delegate. In non-Reflection code I'd do this:
public delegate void myHandler(string arg);
public void myMethod(myHandler mh) {...}
public void myCustomHandler(string arg) {...}
public void setup()
{
myMethod(this.MyCustomHandler);
}
So what I'd like to do instead is sort of call "myMethod(reflectionMethod)";