Skip to content

Instantly share code, notes, and snippets.

@samneirinck
Created March 3, 2012 17:43
Show Gist options
  • Save samneirinck/1967098 to your computer and use it in GitHub Desktop.
Save samneirinck/1967098 to your computer and use it in GitHub Desktop.
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