Exemplo n.º 1
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int startYear, TimeCalendarConfig calendarConfig)
        {
            WriteLine("Input: count={0}, year={1}", periodCount, startYear);
            WriteLine("Calendar: base-month={0}, week-type={1}, culture={2}", calendarConfig.YearBaseMonth, calendarConfig.YearWeekType, calendarConfig.Culture.Name);

            WriteLine();

            YearTimeRange yearTimeRange;

            if (periodCount == 1)
            {
                Year year = new Year(startYear, new TimeCalendar(calendarConfig));
                yearTimeRange = year;

                Year previousYear = year.GetPreviousYear();
                Year nextYears    = year.GetNextYear();

                ShowYear(year);
                ShowCompactYear(previousYear, "Previous Year");
                ShowCompactYear(nextYears, "Next Year");
                WriteLine();
            }
            else
            {
                Years years = new Years(startYear, periodCount, new TimeCalendar(calendarConfig));
                yearTimeRange = years;

                ShowYears(years);
                WriteLine();

                foreach (Year year in years.GetYears())
                {
                    ShowCompactYear(year);
                }
                WriteLine();
            }

            foreach (Halfyear halfyear in yearTimeRange.GetHalfyears())
            {
                HalfyearDemo.ShowCompactHalfyear(halfyear);
            }
            WriteLine();
            foreach (Quarter quarter in yearTimeRange.GetQuarters())
            {
                QuarterDemo.ShowCompactQuarter(quarter);
            }
            WriteLine();
            foreach (Month month in yearTimeRange.GetMonths())
            {
                MonthDemo.ShowCompactMonth(month);
            }
            WriteLine();
        }         // ShowAll
Exemplo n.º 2
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int startYear, YearHalfyear yearHalfyear, TimeCalendarConfig calendarConfig)
        {
            WriteLine("Input: count={0}, year={1}, halfyear={2}", periodCount, startYear, yearHalfyear);
            WriteLine();

            HalfyearTimeRange halfyearTimeRange;

            if (periodCount == 1)
            {
                Halfyear halfyear = new Halfyear(startYear, yearHalfyear, new TimeCalendar(calendarConfig));
                halfyearTimeRange = halfyear;

                Halfyear previousHalfyear = halfyear.GetPreviousHalfyear();
                Halfyear nextHalfyear     = halfyear.GetNextHalfyear();

                ShowHalfyear(halfyear);
                ShowCompactHalfyear(previousHalfyear, "Previous Halfyear");
                ShowCompactHalfyear(nextHalfyear, "Next Halfyear");
                WriteLine();
            }
            else
            {
                Halfyears halfyears = new Halfyears(startYear, yearHalfyear, periodCount, new TimeCalendar(calendarConfig));
                halfyearTimeRange = halfyears;

                ShowHalfyears(halfyears);
                WriteLine();

                foreach (Halfyear halfyear in halfyears.GetHalfyears())
                {
                    ShowCompactHalfyear(halfyear);
                }
                WriteLine();
            }

            foreach (Quarter quarter in halfyearTimeRange.GetQuarters())
            {
                QuarterDemo.ShowCompactQuarter(quarter);
            }
            WriteLine();
            foreach (Month month in halfyearTimeRange.GetMonths())
            {
                MonthDemo.ShowCompactMonth(month);
            }
            WriteLine();
        }         // ShowAll
Exemplo n.º 3
0
        // ----------------------------------------------------------------------
        public static void ShowAll(int periodCount, int startYear, YearQuarter yearQuarter, TimeCalendarConfig calendarConfig)
        {
            WriteLine("Input: count={0}, year={1}, quarter={2}", periodCount, startYear, yearQuarter);
            WriteLine();

            QuarterTimeRange quarterTimeRange;

            if (periodCount == 1)
            {
                Quarter quarter = new Quarter(startYear, yearQuarter, new TimeCalendar(calendarConfig));
                quarterTimeRange = quarter;

                Quarter previousQuarter = quarter.GetPreviousQuarter();
                Quarter nextQuarter     = quarter.GetNextQuarter();

                ShowQuarter(quarter);
                ShowCompactQuarter(previousQuarter, "Previous Quarter");
                ShowCompactQuarter(nextQuarter, "Next Quarter");
                WriteLine();
            }
            else
            {
                Quarters quarters = new Quarters(startYear, yearQuarter, periodCount, new TimeCalendar(calendarConfig));
                quarterTimeRange = quarters;

                ShowQuarters(quarters);
                WriteLine();

                foreach (Quarter quarter in quarters.GetQuarters())
                {
                    ShowCompactQuarter(quarter);
                }
                WriteLine();
            }

            foreach (Month month in quarterTimeRange.GetMonths())
            {
                MonthDemo.ShowCompactMonth(month);
            }
            WriteLine();
        }         // ShowAll