Exemple #1
0
        public static object Call(MethodInfo genericMethodDefinition, Type[] genericArguments, params object[] args)
        {
            //TODO could use emit for more speed
            var genericMethod = GenericMethodMaker.Get(genericMethodDefinition, genericArguments);

            return(genericMethod.Invoke(null, args));
        }
Exemple #2
0
        public static object Call(MethodInfo genericMethodDefinition, Type genericTypeDefinition, params object[] args)
        {
            ArgumentChecker.Not(!genericTypeDefinition.IsGenericTypeDefinition, "genericTypeDefinition");
            ArgumentChecker.NotEmpty(args, "args");
            var genericType      = args[0].GetType();
            var genericArguments = GenericArgs.Get(genericTypeDefinition, genericType);

            return(Call(genericMethodDefinition, genericArguments, args));
        }
Exemple #3
0
 public static MethodInfo GetGenericMethod(Type genericMethodContainingType, string genericMethodName)
 {
     return(GenericMethod.Get(genericMethodContainingType, genericMethodName));
 }
Exemple #4
0
 public TValue Get(TArg1 arg1, TArg2 arg2)
 {
     return(_inner.Get(new Tuple <TArg1, TArg2>(arg1, arg2)));
 }