public List <DailyMustDoInfo> GetDailyMustDoItemByType(MustDoType _type) { Dictionary <int, DailyMustDoInfo> livelyDic = new Dictionary <int, DailyMustDoInfo>(); FDictionary livelyRefTable = ConfigMng.Instance.GetLivelyRefTable(); foreach (var item in livelyRefTable.Values) { LivelyRef livelyRef = item as LivelyRef; if (livelyRef != null && livelyRef.type == (int)_type) { DailyMustDoInfo doInfo = null; if (CurLivelyDic.ContainsKey(livelyRef.id)) { doInfo = new DailyMustDoInfo(CurLivelyDic[livelyRef.id]); //有后台数据 } else { doInfo = new DailyMustDoInfo(livelyRef.id); //没有后台数据 } if (livelyDic.ContainsKey(doInfo.Sort)) { livelyDic[doInfo.Sort].UpdateBySort(doInfo); //同类型的只显示一个 } else { livelyDic[doInfo.Sort] = doInfo; } } } List <DailyMustDoInfo> livelyList = new List <DailyMustDoInfo>(livelyDic.Values); livelyList.Sort(SortMustDoInfo); return(livelyList); }
void OnChange() { if (toggles != null) { for (int i = 0, max = toggles.Length; i < max; i++) { if (toggles[i] != null && toggles[i].value) { CurMustDoType = (MustDoType)(i + 1); } } } ShowMustDoItems(); }