Ejemplo n.º 1
0
        IList ApplyFilter(List<Contact> list, AlphaIndex alpha) {
            if(alpha == AlphaIndex.All) return list;
            var res = from q in list
                    where alpha.Match(extractName(q))
                    select q;
            return res.ToList();

        }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 IList ApplyFilter(List<Contact> list, AlphaIndex alpha)
 {
     if(alpha == AlphaIndex.All || alpha == null)
         return list;
     return list.Where(c => alpha.Match(AlphaIndex.Group(c.LastName))).ToList();
 }
Ejemplo n.º 4
0
 protected void InitIndex(List<Contact> list)
 {
     SetupGrid(Generate(list, c => AlphaIndex.Group(c.LastName)), indexGridControl);
 }