Simple case:
public class MyClass
{
public Action<double> MyAction;
}
public class AnotherClass
{
public void MyAction(double value)
{
// ...
}
}
As I get both AnotherClass.MyAction(..) method and MyClass.MyAction delegate through reflection, I end up with a pair of MethodInfo/FieldInfo classes where I can’t hookup the method to the delegate. Also I get both the method/delegate names from a string, I can’t access the instance fields/methods without reflection. Can anyone give me a hand in this, or is this sort of a hook-up possible at all?
You should look at
Delegate.CreateDelegate, in particular: