コード例 #1
0
        public void ClearDayLabels(DateTime date)
        {
            DayControl day = DayControls.FirstOrDefault(x => x.Date == date);

            if (day != null)
            {
                day.DayItems.Clear();
            }
        }
コード例 #2
0
        public void RemoveDayLabel(DateTime date, String text)
        {
            DayControl day = DayControls.FirstOrDefault(x => x.Date == date);

            if (day != null)
            {
                Label label = day.DayItems.FirstOrDefault(x => x.Content == text);
                if (label != null)
                {
                    day.DayItems.Remove(label);
                }
            }
        }
コード例 #3
0
        public void AddDayLabel(DateTime date, Shift shift, string text, Brush foreground = null, Brush background = null)
        {
            DayControl day = DayControls.FirstOrDefault(x => x.Date.DayOfYear == date.DayOfYear && x.Date.Year == date.Year);

            if (day != null)
            {
                Label label = new Label();
                if (text != null)
                {
                    label.Content = text;
                }
                if (background != null)
                {
                    label.Background = background;
                }
                if (foreground != null)
                {
                    label.Foreground = foreground;
                }
                day.DayItems.Add(label);
                day.ShiftInfo.Add(shift);
            }
        }
コード例 #4
0
        private void AddDayLabel(DateTime date, ShiftTime source, string text, SolidColorBrush foreground, SolidColorBrush background)
        {
            DayControl day = DayControls.FirstOrDefault(x => x.Date.DayOfYear == date.DayOfYear && x.Date.Year == date.Year);

            if (day != null)
            {
                Label label = new Label();
                if (text != null)
                {
                    label.Content = text;
                }
                if (background != null)
                {
                    label.Background = background;
                }
                if (foreground != null)
                {
                    label.Foreground = foreground;
                }
                day.DayItems.Add(label);
                day.ShiftInfo.Add(source);
            }
        }
コード例 #5
0
 public void AddDayControl(TrackingDay day)
 {
     DayControls.Add(new TrackingDayControl(day));
 }