private bool CanExecute <T>(int argsCount) where T : class { Type type = typeof(T); List <MethodInfo> methods = CClassUtils.ListInstanceMethods(type, delegate(MethodInfo method) { return(method.Name.Equals("Execute")); }); Assert.AreEqual(1, methods.Count); return(CCommandUtils.CanInvokeMethodWithArgsCount(methods[0], argsCount)); }
private MethodInfo resolveExecuteMethod(String[] args) { if (executeMethods == null) { executeMethods = resolveExecuteMethods(); } MethodInfo method = null; foreach (MethodInfo m in executeMethods) { if (CCommandUtils.CanInvokeMethodWithArgsCount(m, args.Length)) { if (method != null) // multiple methods found { return(null); } method = m; } } return(method); }