private void UpdateMonths()
        {
            for (var i = 0; i < Months.Count; ++i)
            {
                var month = Months[i];

                month.Date = MonthUtilities.GetMonth(StartDate, i);
            }
        }
示例#2
0
        /*
         * [Description("Selected dates"), Category("MultipleMonthCalendar")]
         * public List<DateTime> SelectedDates {
         *  get { return monthsControl.SelectedDates; }
         *  set { monthsControl.SelectedDates = value; }
         * }
         */
        #endregion

        public MultipleMonthCalendar()
        {
            InitializeComponent();

            nextButton.Click += (sender, args) =>
                                monthsControl.StartDate = MonthUtilities.GetNextMonth(monthsControl.StartDate);

            prevButton.Click += (sender, args) =>
                                monthsControl.StartDate = MonthUtilities.GetPrevMonth(monthsControl.StartDate);
        }
示例#3
0
        static void ExtensionMethods()
        {
            Months m = Months.January;
            Months n = MonthUtilities.NextMonth(m);

            Console.WriteLine($"The month after {m:G} is {n:G}.");

            m = Months.December;
            n = m.NextMonthE();
            Console.WriteLine($"The month after {m:G} is {n:G}.");
        }