예제 #1
0
        public static MethodInfo GetExtensionMethodInfo2(Type type, string methodName)
        {
            return(ReflectionUtil.GetMethodInfo2(type, methodName, 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;
            }));
        }
예제 #2
0
 public static MethodInfo GetMethodInfo2(this Type self, string methodName,
                                         BindingFlags bindingFlags = BindingFlagsConst.All)
 {
     return(ReflectionUtil.GetMethodInfo2(self, methodName, bindingFlags));
 }