private void UpdateMonths() { for (var i = 0; i < Months.Count; ++i) { var month = Months[i]; month.Date = MonthUtilities.GetMonth(StartDate, i); } }
/* * [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); }
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}."); }