Ok. So I use this ->
Then it will return null if such a method doesnt exist.
MethodInfo method = typeof(Program).GetMethods(BindingFlags.Static | BindingFlags.NonPublic).FirstOrDefault(mi => mi.Name == name);
To invoke the method I use
It would be great if you could post a link about more info about this object type.
I'll try to decode it myself here, and please correct me if I'm wrong.
This probably means that I'm looking for a method inside my program?
This searches through the methods in the program according to the paramteres.
These specify for what types of methods I search for. Do they have to be static though?
this probably gets the first method in the list (or first overload) that maches the name the user put in...
FirstOrDefault(mi => mi.Name == name)
Now a few questions =D
1. Can I use non-static and Public methods for this?
2. How would I reference a method from another class?
3. Is it possible to pass arguments? for example
and call it with
input: Method2("Read me!")