예제 #1
0
        protected virtual AutoCompleteEntryCollection FilterList(AutoCompleteEntryCollection list)
        {
            AutoCompleteEntryCollection newList = new AutoCompleteEntryCollection();

            foreach (IAutoCompleteEntry entry in list)
            {
                foreach (string match in entry.MatchStrings)
                {
                    if (match.ToUpper().StartsWith(this.Text.ToUpper()))
                    {
                        newList.Add(entry);
                        break;
                    }
                }
            }
            return(newList);
        }
예제 #2
0
        protected virtual AutoCompleteEntryCollection FilterList(AutoCompleteEntryCollection list)
        {
            if (!autoCompleteEnabled)
            {
                return(new AutoCompleteEntryCollection());
            }
            AutoCompleteEntryCollection newList = new AutoCompleteEntryCollection();

            string[] words = this.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (IAutoCompleteEntry entry in list)
            {
                int count = 0;
                foreach (string match in entry.MatchStrings)
                {
                    if (!orWord)
                    {
                        if (match.ToUpper().StartsWith(this.Text.ToUpper()))
                        {
                            newList.Add(entry);
                            break;
                        }
                    }
                    else
                    {
                        foreach (string word in words)
                        {
                            if (match.ToUpper().StartsWith(word.ToUpper()))
                            {
                                count++;
                            }
                        }
                    }
                }
                if (count == words.Length)
                {
                    newList.Add(entry);
                }
            }
            return(newList);
        }
예제 #3
0
 protected virtual AutoCompleteEntryCollection FilterList(AutoCompleteEntryCollection list)
 {
     AutoCompleteEntryCollection newList = new AutoCompleteEntryCollection();
     foreach (IAutoCompleteEntry entry in list)
     {
         foreach (string match in entry.MatchStrings)
         {
             if (match.ToUpper().StartsWith(this.Text.ToUpper()))
             {
                 newList.Add(entry);
                 break;
             }
         }
     }
     return newList;
 }