Пример #1
0
            protected override List <object> _Filter(List <object> _unfilteredData, string _displayMember, string userInput)
            {
                int    count       = userInput.Length - 1;
                string userLetters = userInput.ToLower();

                List <object> results = new List <object>();


                foreach (var obj in _unfilteredData)
                {
                    var itemLetters = GetFilterString(obj, _displayMember).ToLower();

                    if (count < itemLetters.Length)
                    {
                        char currentLetter = itemLetters[count];

                        // 如果是英文

                        if (CharUtil.IsEnglishLetter(currentLetter))
                        {
                            if (currentLetter.ToString().ToLower()[0] == userLetters[count])
                            {
                                results.Add(obj);
                            }
                            continue;
                        }
                    }
                }
                return(results);
            }