public void LoadTimeCells() { if (60 % TemplateScheduleCalendar.INCREMENT == 0) { TimeSpan timeCount = TemplateScheduleCalendar.STARTTIME; int rowCount = 0; while (timeCount <= TemplateScheduleCalendar.ENDTIME.Add(new TimeSpan(0, 60 - TemplateScheduleCalendar.INCREMENT, 0))) { DayColumnGrid.RowDefinitions.Add(new RowDefinition()); TimeCell tempTimeCell = new TimeCell() { Time = timeCount, WeekDay = DayOfWeek }; DayColumnGrid.Children.Add(tempTimeCell); Panel.SetZIndex(tempTimeCell, 100); Grid.SetRow(tempTimeCell, rowCount); TimeCellList.Add(tempTimeCell); rowCount++; timeCount = timeCount.Add(new TimeSpan(0, TemplateScheduleCalendar.INCREMENT, 0)); } } }
public void ResetTimeCells() { TimeCellList.ForEach(x => { x.Visibility = System.Windows.Visibility.Visible; Panel.SetZIndex(x, 100); x.ShiftAndRootCell.Clear(); }); }
public TimeCell GetNextTimeCell(TimeCell timeCell) { TimeCell res = timeCell; int index = TimeCellList.IndexOf(timeCell); if ((index + 1) < TimeCellList.Count) { res = TimeCellList[index + 1]; } return(res); }
internal void Clear() { Shifts.Clear(); TimeCellList.ForEach(x => x.Clear()); }
public TimeCell FindMatchingTimeCell(TimeSpan time) { return(TimeCellList.Find(x => x.Time == time)); }