private List <DateTime> getStartTimes() {//the purpose of this function is to get the starttimes from the checked items of the listviews List <DateTime> result = new List <DateTime>(); for (int n = 0; n < lvTimeSlots.CheckedItems.Count; n++) //go through each of the checked items { result.Add(DateTimeMethods.getDate(lvTimeSlots.CheckedItems[n].SubItems[0].Text.ToString())); //add the start time date to the list } return(result); //return the desired list }
private void loadListView(List <string> removeList) {//this function is made to load the listviews with times of prospective desired remove times for (int i = 0; i < removeList.Count(); i++) { DateTime startTime = DateTimeMethods.getDate(removeList[i].Split(',')[0]); //get the start time DateTime endTime = DateTimeMethods.getDate(removeList[i].Split(',')[1]); //get the end time string weekly = "No"; if (removeList[i].Split(',')[2] == "True" || removeList[i].Split(',')[2] == "Yes") { weekly = "Yes"; } while (DateTimeMethods.startEarlierThanEnd(startTime, endTime)) //if the start time is before the end time, add the strings to the listviews { lvTimeSlots.Items.Add(new ListViewItem(new string[] { startTime.ToString(), startTime.AddMinutes(15).ToString(), weekly })); startTime = startTime.AddMinutes(15); //add the next 15 minute time block } } }