Exemple #1
0
 protected bool Equals(JavaMemberInfo other)
 {
     return(Equals(Member, other.Member));
 }
Exemple #2
0
 protected bool Equals(JavaMemberInfo other)
 {
     return Equals(Member, other.Member);
 }
Exemple #3
0
        public static bool IsMatch(JavaMemberInfo memberInfo, BindingFlags flags)
        {
            // this methods is heavily used during reflection, so we have traded
            // readablility for performance.

            if (flags == BindFlags.AllMembers || flags == BindFlags.DeclaredMembers)
                return true;

            bool incStatic   = (flags & BindingFlags.Static)   == BindingFlags.Static;
            bool incInstance = (flags & BindingFlags.Instance) == BindingFlags.Instance;

            if (incInstance == incStatic && !incInstance)
                return false;

            if (incInstance != incStatic)
            {
                bool isStatic = memberInfo.IsStatic;

                if (!((incStatic && isStatic) || (incInstance && !isStatic)))
                    return false;
            }

            bool incPublic    = (flags & BindingFlags.Public)    == BindingFlags.Public;
            bool incNonPublic = (flags & BindingFlags.NonPublic) == BindingFlags.NonPublic;

            if (incPublic == incNonPublic)
                return incPublic;

            bool isPublic = memberInfo.IsPublic;
            return (incPublic && isPublic) || (incNonPublic && !isPublic);
        }