Exemplo n.º 1
0
        public static MethodInfo GetGeneric <TAct>(this object obj, TAct act, params Type[] types)
        {
            MethodInfo methodInfo        = new MethodOf <TAct>(act);
            var        genMethod         = methodInfo.GetGenericMethodDefinition();
            var        constructedMethod = genMethod.MakeGenericMethod(types);

            return(constructedMethod);
        }
Exemplo n.º 2
0
        public static TAct Call <TAct>(this object obj, TAct act)
        {
            MethodInfo methodInfo = new MethodOf <TAct>(act);

            return(methodInfo.CreateDelegate <TAct>(obj));
        }