Created
March 3, 2012 17:43
-
-
Save samneirinck/1967098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var methodInfo = scriptInstance.GetType().GetMethods().First(method => | |
{ | |
var parameters = method.GetParameters(); | |
if (method.Name == func) | |
{ | |
if ((parameters == null || parameters.Length == 0) && args == null) | |
return true; | |
else if (parameters.Length == args.Length) | |
{ | |
for (int i = 0; i < args.Length; i++) | |
{ | |
if (parameters[i].ParameterType == args[i]) | |
return true; | |
} | |
} | |
} | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment