clojure.lang.Reflector.GetMethods C# (CSharp) Метод

GetMethods() статический приватный Метод

Get methods of fixed name and arity.
static private GetMethods ( Type targetType, string methodName, IList typeArgs, int arity, bool getStatics ) : IList
targetType System.Type
methodName string
typeArgs IList
arity int
getStatics bool
Результат IList
        internal static IList<MethodBase> GetMethods(Type targetType, string methodName, IList<Type> typeArgs, int arity, bool getStatics)
        {
            BindingFlags flags = BindingFlags.Public | BindingFlags.FlattenHierarchy | BindingFlags.InvokeMethod;
            flags |= getStatics ? BindingFlags.Static : BindingFlags.Instance;

            List<MethodBase> infos;

            if (targetType.IsInterface && !getStatics)
                infos = GetInterfaceMethods(targetType, methodName, typeArgs, arity);
            else
            {
                IEnumerable<MethodInfo> einfos
                    = targetType.GetMethods(flags).Where(info => info.Name == methodName && info.GetParameters().Length == arity);
                infos = new List<MethodBase>();
                foreach (MethodInfo minfo in einfos)
                    if (typeArgs != null && minfo.ContainsGenericParameters)
                        infos.Add(minfo.MakeGenericMethod(typeArgs.ToArray<Type>()));
                    else
                        infos.Add(minfo);
            }
            return infos;
        }