public void loadListToCheckListBox(DateTime dt) { clbEventShow.Items.Clear(); // when choosing a new day, delete previous day's events flpStatus.Controls.Clear(); disableButtons(); for (int i = 0; i < EvList.Count; i++) { if (EvList[i].Date.Year == dt.Year && EvList[i].Date.Month == dt.Month && EvList[i].Date.Day == dt.Day) { unsortedList.Add(EvList[i]); } } unsortedList = UtilityFunctions.boxSort(unsortedList); for (int j = 0; j < unsortedList.Count; j++) { clbEventShow.Items.Add(UtilityFunctions.clbFormat(unsortedList[j])); drawStatus(UtilityFunctions.loadStatus(unsortedList[j])); } unsortedList.Clear(); }
private void tmNotify_Tick(object sender, EventArgs e) { if (!cbNotify.Checked) { return; } myTime++; if (myTime < Cons.notifyTime) { return; } if (EvList == null) { return; } int count = 0; for (int i = 0; i < EvList.Count; i++) { if (EvList[i].Date.Year == DateTime.Now.Year && EvList[i].Date.Month == DateTime.Now.Month && EvList[i].Date.Day == DateTime.Now.Day && UtilityFunctions.loadStatus(EvList[i]) == "NOT STARTED") { count++; } if (count > 0 && (EvList[i].Date.Year != DateTime.Now.Year || EvList[i].Date.Month != DateTime.Now.Month || EvList[i].Date.Day != DateTime.Now.Day)) { break; } } if (count == 0) { return; } Notify.ShowBalloonTip(Cons.notifyTimeout, "Schedule", string.Format("You have {0} work(s) left for today", count), ToolTipIcon.Info); myTime = 0; }