Is there a way to send a any method as a parameter? I need to do it for all kind of method, not caring about signatures and returns. Say something like this (bad code, just for the idea):
public class Foo
{
...
void TestMethod(DontKnowWhatToPutHere theDelegate) {}
...
}
...
foo.TestMethod(-foo.AnotherMethod(1,2)-);
foo.TestMethod(-foo.AnotherMethod("I don't care method signature nor returning type")-);
I tried with no success to do it with Action
as parameter.
What I need to do is to send any method to a function, and then use reflection to get method name and parameters, so if there's another way you guys can figure out, I would gladly hear about it too.