Inheritance: TimePeriodDemo
Exemple #1
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int year, YearMonth yearMonth)
        {
            WriteLine("Input: year={0}, month={1}", year, yearMonth);
            WriteLine();

            BroadcastMonth month = new BroadcastMonth(year, yearMonth);

            BroadcastMonth previousMonth = month.GetPreviousMonth();
            BroadcastMonth nextMonth     = month.GetNextMonth();

            ShowMonth(month);
            ShowCompactMonth(previousMonth, "Previous BroadcastMonth");
            ShowCompactMonth(nextMonth, "Next BroadcastMonth");
            WriteLine();

            foreach (BroadcastWeek week in month.GetWeeks())
            {
                BroadcastWeekDemo.ShowCompactWeek(week);
            }
            WriteLine();
            foreach (Day day in month.GetDays())
            {
                DayDemo.ShowCompactDay(day);
            }
            WriteLine();
        }         // ShowAll
Exemple #2
0
        }         // QueryPeriodData

        // ----------------------------------------------------------------------
        private static void ShowPeriodData(string periodType, TimePeriodDemoData demoData)
        {
            Console.WriteLine();
            Console.WriteLine("Time Period Demo");
            Console.WriteLine("Start: {0}", demoData.SetupDate);

            switch (periodType.ToLower())
            {
            case "y":
                YearDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.CalendarConfig);
                break;

            case "by":
                BroadcastYearDemo.ShowAll(demoData.Year);
                break;

            case "hy":
                HalfyearDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Halfyear, demoData.CalendarConfig);
                break;

            case "q":
                QuarterDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Quarter, demoData.CalendarConfig);
                break;

            case "m":
                MonthDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Month);
                break;

            case "bm":
                BroadcastMonthDemo.ShowAll(demoData.Year, demoData.Month);
                break;

            case "w":
                WeekDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Week, demoData.CalendarConfig);
                break;

            case "bw":
                BroadcastWeekDemo.ShowAll(demoData.Year, demoData.Week);
                break;

            case "d":
                DayDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Month, demoData.Day);
                break;

            case "h":
                HourDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Month, demoData.Day, demoData.Hour);
                break;

            case "min":
                MinuteDemo.ShowAll(demoData.PeriodCount, demoData.Year, demoData.Month, demoData.Day, demoData.Hour, demoData.Minute);
                break;
            }
        } // StartCalendarDemo
Exemple #3
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int year, int weekOfYear, TimeCalendarConfig calendarConfig)
        {
            WriteLine("Input: year={0}, week={1}", year, weekOfYear);
            WriteLine();

            WeekTimeRange weekTimeRange;

            if (periodCount == 1)
            {
                Week week = new Week(year, weekOfYear, new TimeCalendar(calendarConfig));
                weekTimeRange = week;

                Week previousWeek = week.GetPreviousWeek();
                Week nextWeek     = week.GetNextWeek();

                ShowWeek(week);
                ShowCompactWeek(previousWeek, "Previous Week");
                ShowCompactWeek(nextWeek, "Next Week");
                WriteLine();
            }
            else
            {
                Weeks weeks = new Weeks(year, weekOfYear, periodCount, new TimeCalendar(calendarConfig));
                weekTimeRange = weeks;

                ShowWeeks(weeks);
                WriteLine();

                foreach (Week week in weeks.GetWeeks())
                {
                    ShowCompactWeek(week);
                }
                WriteLine();
            }

            foreach (Day day in weekTimeRange.GetDays())
            {
                DayDemo.ShowCompactDay(day);
            }
            WriteLine();
        }         // ShowAll
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int year, YearMonth yearMonth)
        {
            WriteLine("Input: count={0}, year={1}, month={2}", periodCount, year, yearMonth);
            WriteLine();

            MonthTimeRange monthTimeRange;

            if (periodCount == 1)
            {
                Month month = new Month(year, yearMonth);
                monthTimeRange = month;

                Month previousMonth = month.GetPreviousMonth();
                Month nextMonth     = month.GetNextMonth();

                ShowMonth(month);
                ShowCompactMonth(previousMonth, "Previous Month");
                ShowCompactMonth(nextMonth, "Next Month");
                WriteLine();
            }
            else
            {
                Months months = new Months(year, yearMonth, periodCount);
                monthTimeRange = months;

                ShowMonths(months);
                WriteLine();

                foreach (Month month in months.GetMonths())
                {
                    ShowCompactMonth(month);
                }
                WriteLine();
            }

            foreach (Day day in monthTimeRange.GetDays())
            {
                DayDemo.ShowCompactDay(day);
            }
            WriteLine();
        }         // ShowAll
Exemple #5
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int year, int weekOfYear)
        {
            WriteLine("Input: year={0}, week={1}", year, weekOfYear);
            WriteLine();

            BroadcastWeek week = new BroadcastWeek(year, weekOfYear);

            BroadcastWeek previousWeek = week.GetPreviousWeek();
            BroadcastWeek nextWeek     = week.GetNextWeek();

            ShowWeek(week);
            ShowCompactWeek(previousWeek, "Previous BroadcastWeek");
            ShowCompactWeek(nextWeek, "Next BroadcastWeek");
            WriteLine();

            foreach (Day day in week.GetDays())
            {
                DayDemo.ShowCompactDay(day);
            }
            WriteLine();
        }         // ShowAll