Exemplo n.º 1
0
        public static MethodInfo GetExtensionGenericMethodInfo2(Type type, string methodName, Type[] genericTypes)
        {
            return(ReflectionUtil.GetGenericMethodInfo2(type, methodName, genericTypes, BindingFlagsConst.All,
                                                        () =>
            {
                var methodInfos = GetExtensionMethodInfos(type);
                if (methodInfos.IsNullOrEmpty())
                {
                    return null;
                }
                for (var i = 0; i < methodInfos.Length; i++)
                {
                    var methodInfo = methodInfos[i];
                    if (methodInfo.Name.Equals(methodName))
                    {
                        return methodInfo;
                    }
                }

                return null;
            }));
        }
Exemplo n.º 2
0
 public static MethodInfo GetGenericMethodInfo2(this Type self, string methodName, Type[] genericTypes,
                                                BindingFlags bindingFlags = BindingFlagsConst.All)
 {
     return(ReflectionUtil.GetGenericMethodInfo2(self, methodName, genericTypes, bindingFlags));
 }