コード例 #1
0
        public void ScheduleDaysChanged(Calendar.Service calendarService)
        {
            switch (calendarService)
            {
            case Calendar.Service.WorkingDays:
                CurrentTimetable = TimetableWorkingDays;
                break;

            case Calendar.Service.Saturdays:
                CurrentTimetable = TimetableSaturdays;
                break;

            case Calendar.Service.SundayAndHolidays:
                CurrentTimetable = TimetableHolidays;
                break;
            }

            HighlightNextBus();
            _currentCalendarService = calendarService;
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentTimetable)));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(WorkingDaysVisible)));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SaturdaysVisible)));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(HolidaysVisible)));
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(NextBus)));
        }
コード例 #2
0
        private void ShowScheduleForToday()
        {
            var today = DateTime.Today;

            if (today.DayOfWeek == DayOfWeek.Saturday)
            {
                _currentCalendarService = Calendar.Service.Saturdays;
                CurrentTimetable        = TimetableSaturdays;
            }
            else if (today.DayOfWeek == DayOfWeek.Sunday || HolidaysHelper.IsTodayHoliday())
            {
                _currentCalendarService = Calendar.Service.SundayAndHolidays;
                CurrentTimetable        = TimetableHolidays;
            }
            else
            {
                _currentCalendarService = Calendar.Service.WorkingDays;
                CurrentTimetable        = TimetableWorkingDays;
            }
        }