i have a MethodInfo object, that defines a method i want to call.
Except i need the object that MethodInfo came from.
pseudo-code:
void CallMethod(MethodInfo m)
{
Object o = Activator.CreateInstance(m.ClassType);
o.GetType().InvokeMember(m.Name, BindingFlags.InvokeMethod, null, o, null);
}
Except i don’t know how to get the type of the class that MethodInfo belongs to.
How can i call a MethodInfo?
This will create an object from the type that your
MethodInfois, and will invoke it for you on that new object.