Пример #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);
        }
Пример #2
0
        public static TAct Call <TAct>(this object obj, TAct act)
        {
            MethodInfo methodInfo = new MethodOf <TAct>(act);

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