I will just add the code ... because. I do not agree with this code, but it is pretty straight forward. Hope this helps someone who stumbles about it. It is tested, although probably not as good as you would like in a production environment:
The methodName method call on the obj object with args arguments:
public Tuple<bool, object> Evaluate(IScopeContext c, object obj, string methodName, object[] args) {
And the ArgumentListMatches function below, which basically replaces the logic that is probably found in GetMethod:
public static bool ArgumentListMatches(this MethodInfo m, Type[] args) {
Lots of LINQ, and it has not been tested for performance!
In addition, it will not handle calls to a common function or method. This makes it significantly more ugly (as in GetMethod repeated calls).
Gordon Mar 19 '15 at 22:55 2015-03-19 22:55
source share