IList ApplyFilter(List <AMR_MST04> list, AlphaIndex_AptManage alpha) { if (alpha == null || alpha == AlphaIndex_AptManage.All) { return(list); } var res = from q in list where alpha.Match(extractName(q)) select q; return(res.ToList()); }
protected void InitIndex(List <AMR_MST04> list) { this.extractName = (s) => { string name = ((AMR_MST04)s).MST04CMP; if (string.IsNullOrEmpty(name)) { return(null); //todo? } return(AlphaIndex_AptManage.Group(name.Substring(0, 1))); }; List <AlphaIndex_AptManage> dict = Generate(list, extractName); SetupGrid(dict, indexGridControl); }
IList ApplyFilter(List<AMR_MST04> list, AlphaIndex_AptManage alpha) { if(alpha == null || alpha == AlphaIndex_AptManage.All) return list; var res = from q in list where alpha.Match(extractName(q)) select q; return res.ToList(); }