コード例 #1
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int year)
        {
            WriteLine("Input: year={0}", year);

            WriteLine();

            BroadcastYear broadcastYear = new BroadcastYear(year);

            BroadcastYear previousYear = broadcastYear.GetPreviousYear();
            BroadcastYear nextYears    = broadcastYear.GetNextYear();

            ShowYear(broadcastYear);
            ShowCompactYear(previousYear, "Previous BroadcastYear");
            ShowCompactYear(nextYears, "Next BroadcastYear");
            WriteLine();

            foreach (BroadcastMonth month in broadcastYear.GetMonths())
            {
                BroadcastMonthDemo.ShowCompactMonth(month);
            }
            WriteLine();
            foreach (BroadcastWeek week in broadcastYear.GetWeeks())
            {
                BroadcastWeekDemo.ShowCompactWeek(week);
            }
            WriteLine();
        }         // ShowAll
コード例 #2
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
コード例 #3
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