Esempio n. 1
0
        private List <MethodInfo> LookupStaticSetters(string name)
        {
            MemberInfo[]      setters = UnderlyingType.GetMember(KnownStrings.Set + name, MemberTypes.Method, AttachableProperties_BF);
            List <MethodInfo> preferredSetters, otherSetters;

            PrioritizeAccessors(setters, false /*isEvent*/, false /*isGetter*/, out preferredSetters, out otherSetters);
            return(preferredSetters ?? otherSetters);
        }
Esempio n. 2
0
        private List <MethodInfo> LookupStaticAdders(string name)
        {
            string adderName = KnownStrings.Add + name + KnownStrings.Handler;

            MemberInfo[]      adders = UnderlyingType.GetMember(adderName, MemberTypes.Method, AttachableProperties_BF);
            List <MethodInfo> preferredAdders, otherAdders;

            PrioritizeAccessors(adders, true /*isEvent*/, false /*isGetter*/, out preferredAdders, out otherAdders);
            return(preferredAdders ?? otherAdders);
        }
Esempio n. 3
0
        private PropertyInfo GetNonIndexerProperty(string name)
        {
            // Choose the most derived non-index property, in case of shadowing
            PropertyInfo mostDerived = null;

            MemberInfo[] infos = UnderlyingType.GetMember(name, MemberTypes.Property, AllProperties_BF);
            foreach (PropertyInfo pi in infos)
            {
                if (pi.GetIndexParameters().Length == 0)
                {
                    if (mostDerived == null || mostDerived.DeclaringType.IsAssignableFrom(pi.DeclaringType))
                    {
                        mostDerived = pi;
                    }
                }
            }
            return(mostDerived);
        }