Exemple #1
0
 private static ConstructorInfo FindCtorBySignature(
     IEnumerable <ConstructorInfo> constructors,
     object[] parameters)
 {
     return(parameters.Length == 0 ?
            FindDefaultCtor(constructors) :
            ArgumentSignatureMatcher.FindBestMatching(constructors, parameters));
 }
Exemple #2
0
        private static Result InvokeMethod <T>(
            bool @static,
            object target,
            string methodName,
            params object[] parameters)
        {
            var methods = FindMethodsByName <T>(methodName, @static: @static);

            var method = ArgumentSignatureMatcher.FindBestMatching(methods, parameters);

            return(Invoke(@static, method, target, parameters));
        }