private bool ContainsPublics(IMemberDatabase source, int index)
        {
            SymbolType     type     = source.GetMemberType(index);
            SymbolModifier modifier = source.GetMemberModifiers(index);

            // If this is a public type or extension method, we contain them
            if ((type.IsType() || type.IsExtensionMethod()) && modifier.HasFlag(SymbolModifier.Public))
            {
                return(true);
            }

            // If any descendants contain public types, we contain them
            int childIndex = source.DeclaredMembers.GetFirstChild(index);

            while (childIndex > 0)
            {
                if (ContainsPublics(source, childIndex))
                {
                    return(true);
                }
                childIndex = source.DeclaredMembers.GetNextSibling(childIndex);
            }

            // Otherwise, we don't
            return(false);
        }
示例#2
0
        private bool MatchesDetailed(ItemTree declaredMembers, StringStore strings, IMemberDatabase db, int symbolIndex)
        {
            if (!Matches(declaredMembers, strings, symbolIndex))
            {
                return(false);
            }

            if (Type != SymbolType.Any && db.GetMemberType(symbolIndex) != Type)
            {
                return(false);
            }
            if (!Modifiers.Matches(db.GetMemberModifiers(symbolIndex)))
            {
                return(false);
            }

            // ISSUE: Need a way to specify you want the empty params overload of a method (other than full match)
            // NOTE: Parameters8 was a copy gotten from StringStore to make this comparison fast (rather than a byte-by-byte comparison)
            // NOTE: Case insensitive comparison because StringStore lookup was case-insensitive, so Parameters8 casing isn't specific
            // NOTE: Need String8 rather than just checking Range.Contains because IMemberDatabase doesn't offer returning the identifier
            if ((IsFullSuffix || !this.ParametersIdentifiers.IsEmpty()) && db.GetMemberParameters(symbolIndex).CompareTo(Parameters8, true) != 0)
            {
                return(false);
            }

            return(true);
        }