20 writes to MaxDate
System.Windows.Forms (1)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
1612private void ResetMaxDate() => MaxDate = DateTime.MaxValue;
System.Windows.Forms.Tests (16)
System\Windows\Forms\AccessibleObjects\MonthCalendar.MonthCalendarAccessibleObjectTests.cs (1)
145monthCalendar.MaxDate = maxDate;
System\Windows\Forms\MonthCalendarTests.cs (15)
1168MaxDate = new DateTime(2020, 2, 3, 4, 5, 6, 7) 1324MaxDate = value 1332calendar.MaxDate = value; 1352calendar.MaxDate = value; 1362calendar.MaxDate = value; 1376Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MaxDate = calendar.MinDate.AddTicks(-1)); 2021calendar.MaxDate = new DateTime(2019, 9, 3); 2101calendar.MaxDate = new DateTime(2019, 9, 3); 2223calendar.MaxDate = new DateTime(2019, 9, 3); 2921calendar.MaxDate = new DateTime(2019, 9, 3); 4038calendar.MaxDate = new DateTime(2019, 9, 3); 4154calendar.MaxDate = new DateTime(2019, 9, 3); 4512calendar.MaxDate = DateTime.MaxValue; 4518ShouldSerializeProperty(() => calendar.TestAccessor().Dynamic.ShouldSerializeMaxDate(), () => calendar.MaxDate = DateTime.Now.AddYears(2)); 4665calendar.MaxDate = new DateTime(2022, 12, 31);
System.Windows.Forms.UI.IntegrationTests (1)
MonthCalendarTests.cs (1)
210MaxDate = s_maxDate
WinFormsControlsTest (2)
Calendar.cs (2)
53monthCalendar1.MaxDate = maxDateDateTimePicker.Value; 68monthCalendar1.MaxDate = MaximumDateTime;
46 references to MaxDate
System.Windows.Forms (2)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
648ArgumentOutOfRangeException.ThrowIfGreaterThan(value, MaxDate);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
472internal DateTime MaxDate => this.TryGetOwnerAs(out MonthCalendar? owner) ? owner.MaxDate : DateTime.MaxValue;
System.Windows.Forms.Tests (43)
System\Windows\Forms\MonthCalendarTests.cs (43)
95Assert.Equal(new DateTime(9998, 12, 31), control.MaxDate); 1326Assert.Equal(expected, calendar.MaxDate); 1333Assert.Equal(expected, calendar.MaxDate); 1353Assert.Equal(expected, calendar.MaxDate); 1363Assert.Equal(expected, calendar.MaxDate); 1509Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.MinDate = calendar.MaxDate.AddTicks(1)); 2018calendar.SelectionStart = calendar.MaxDate.AddTicks(1); 2019Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionStart); 2022Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionStart = calendar.MaxDate.AddTicks(1)); 2099Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1)); 2102Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.SelectionEnd = calendar.MaxDate.AddTicks(1)); 2215calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddTicks(1), calendar.MaxDate); 2216Assert.Equal(calendar.MaxDate, calendar.SelectionStart); 2217Assert.Equal(calendar.MaxDate.AddTicks(1).Date, calendar.SelectionEnd); 2219calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddTicks(1)); 2220Assert.Equal(calendar.MaxDate, calendar.SelectionStart); 2221Assert.Equal(calendar.MaxDate.AddTicks(1).Date, calendar.SelectionEnd); 2224Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate)); 2225Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1))); 2918calendar.TodayDate = calendar.MaxDate.AddTicks(1); 2919Assert.Equal(calendar.MaxDate.AddTicks(1).Date, calendar.TodayDate); 2922Assert.Throws<ArgumentOutOfRangeException>("value", () => calendar.TodayDate = calendar.MaxDate.AddDays(1)); 4034calendar.SetDate(calendar.MaxDate.AddTicks(1)); 4035Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionStart); 4036Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionEnd); 4039Assert.Throws<ArgumentOutOfRangeException>("date", () => calendar.SetDate(calendar.MaxDate.AddDays(1))); 4146calendar.SetSelectionRange(calendar.MaxDate.AddTicks(1), calendar.MaxDate); 4147Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionStart); 4148Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionEnd); 4150calendar.SetSelectionRange(calendar.MaxDate, calendar.MaxDate.AddTicks(1)); 4151Assert.Equal(calendar.MaxDate, calendar.SelectionStart); 4152Assert.Equal(calendar.MaxDate.AddTicks(1), calendar.SelectionEnd); 4155Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SetSelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate)); 4156Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SetSelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1))); 4669calendar.MaxDate.Should().Be(new DateTime(9998, 12, 31));
WinFormsControlsTest (1)
Calendar.cs (1)
36if (minDateDateTimePicker.Value > monthCalendar1.MaxDate)