예제 #1
0
        IList ApplyFilter(List <Contact> list, AlphaIndex alpha)
        {
            if (alpha == null || alpha == AlphaIndex.All)
            {
                return(list);
            }
            var res = from q in list
                      where alpha.Match(extractName(q))
                      select q;

            return(res.ToList());
        }
예제 #2
0
        protected void InitIndex(List <Contact> list)
        {
            this.extractName = (s) => {
                string name = ((Contact)s).LastName;
                if (string.IsNullOrEmpty(name))
                {
                    return(null);                           //todo?
                }
                return(AlphaIndex.Group(name.Substring(0, 1)));
            };
            List <AlphaIndex> dict = Generate(list, extractName);

            SetupGrid(dict, indexGridControl);
        }
예제 #3
0
파일: UserManage.cs 프로젝트: shine8319/DLS
        IList ApplyFilter(List<UserInfo> list, AlphaIndex alpha)
        {
            if(alpha == null || alpha == AlphaIndex.All) return list;
            var res = from q in list
                    where alpha.Match(extractName(q))
                    select q;
            return res.ToList();

        }