コード例 #1
0
        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));
                }
            }
        }
コード例 #2
0
 public void ResetTimeCells()
 {
     TimeCellList.ForEach(x =>
     {
         x.Visibility = System.Windows.Visibility.Visible;
         Panel.SetZIndex(x, 100);
         x.ShiftAndRootCell.Clear();
     });
 }
コード例 #3
0
        public TimeCell GetNextTimeCell(TimeCell timeCell)
        {
            TimeCell res   = timeCell;
            int      index = TimeCellList.IndexOf(timeCell);

            if ((index + 1) < TimeCellList.Count)
            {
                res = TimeCellList[index + 1];
            }
            return(res);
        }
コード例 #4
0
 internal void Clear()
 {
     Shifts.Clear();
     TimeCellList.ForEach(x => x.Clear());
 }
コード例 #5
0
 public TimeCell FindMatchingTimeCell(TimeSpan time)
 {
     return(TimeCellList.Find(x => x.Time == time));
 }