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