Beispiel #1
0
        /// <summary>
        /// Checks whether an item matches the search query
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool Matches(VSSearchableItem item, IVsSearchToken[] tokens)
        {
            foreach (IVsSearchToken token in tokens)
            {
                bool tokenMatches = false;

                // We'll search description and name
                if (item.Name.IndexOf(token.ParsedTokenText, StringComparison.CurrentCultureIgnoreCase) != -1)
                    tokenMatches = true;

                if (item.Description != null && item.Description.IndexOf(token.ParsedTokenText, StringComparison.CurrentCultureIgnoreCase) != -1)
                    tokenMatches = true;

                if (!tokenMatches)
                    return false;
            }

            return true;
        }
 public VSSearchResult(VSSearchableItem item, IVsSearchProvider provider)
 {
     this.Item = item;
     this.Provider = provider;
 }