47 references to new
System.Windows.Forms (5)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (1)
712
get =>
new
(SelectionStart, SelectionEnd);
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (4)
57
return new
SelectionRange
(DateTime.Now.Date, DateTime.Now.Date);
68
return new
SelectionRange
(values[0], values[1]);
79
return new
SelectionRange
(dt, dt);
145
return new
SelectionRange
((DateTime)propertyValues["Start"]!,
System.Windows.Forms.Tests (42)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (6)
124
yield return new object[] { 0, new
SelectionRange
(new DateTime(2020, 12, 27), new DateTime(2021, 1, 31)) };
125
yield return new object[] { 1, new
SelectionRange
(new DateTime(2021, 2, 1), new DateTime(2021, 2, 28)) };
126
yield return new object[] { 2, new
SelectionRange
(new DateTime(2021, 3, 1), new DateTime(2021, 3, 31)) };
127
yield return new object[] { 3, new
SelectionRange
(new DateTime(2021, 4, 1), new DateTime(2021, 4, 30)) };
128
yield return new object[] { 4, new
SelectionRange
(new DateTime(2021, 5, 1), new DateTime(2021, 5, 31)) };
129
yield return new object[] { 5, new
SelectionRange
(new DateTime(2021, 6, 1), new DateTime(2021, 7, 10)) };
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (3)
13
private readonly SelectionRange _range =
new
(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31));
95
SelectionRange range =
new
(start, end);
154
SelectionRange range = new
SelectionRange
(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (33)
1025
SelectionRange = new
SelectionRange
(lower, upper)
2107
yield return new object[] { new
SelectionRange
(DateTime.MinValue, DateTime.MinValue), DateTime.MinValue, DateTime.MinValue };
2108
yield return new object[] { new
SelectionRange
(new DateTime(1753, 1, 1).AddTicks(-1), new DateTime(1753, 1, 1).AddTicks(-1)), new DateTime(1752, 12, 31), new DateTime(1752, 12, 31) };
2109
yield return new object[] { new
SelectionRange
(new DateTime(1753, 1, 1), new DateTime(1753, 1, 1)), new DateTime(1753, 1, 1), new DateTime(1753, 1, 1) };
2110
yield return new object[] { new
SelectionRange
(new DateTime(1753, 1, 1), new DateTime(1753, 1, 2)), new DateTime(1753, 1, 1), new DateTime(1753, 1, 2) };
2112
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 1), new DateTime(2019, 9, 1)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 1) };
2113
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 1), new DateTime(2019, 9, 2)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 2) };
2114
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 1).AddHours(1), new DateTime(2019, 9, 2).AddHours(1)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 2) };
2115
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 2), new DateTime(2019, 9, 1)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 2) };
2116
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 1), new DateTime(2019, 9, 7)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 7) };
2117
yield return new object[] { new
SelectionRange
(new DateTime(2019, 9, 1), new DateTime(2019, 9, 8)), new DateTime(2019, 9, 1), new DateTime(2019, 9, 7) };
2119
yield return new object[] { new
SelectionRange
(DateTime.Now.Date, DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date };
2120
yield return new object[] { new
SelectionRange
(DateTime.Now.Date, DateTime.Now.Date.AddDays(1)), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) };
2121
yield return new object[] { new
SelectionRange
(DateTime.Now.Date.AddHours(1), DateTime.Now.Date.AddHours(1)), DateTime.Now.Date, DateTime.Now.Date };
2122
yield return new object[] { new
SelectionRange
(DateTime.Now.Date.AddDays(1), DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) };
2123
yield return new object[] { new
SelectionRange
(DateTime.Now.Date, DateTime.Now.Date.AddDays(6)), DateTime.Now.Date, DateTime.Now.Date.AddDays(6) };
2124
yield return new object[] { new
SelectionRange
(DateTime.Now.Date, DateTime.Now.Date.AddDays(7)), DateTime.Now.Date.AddDays(1), DateTime.Now.Date.AddDays(7) };
2126
yield return new object[] { new
SelectionRange
(new DateTime(9998, 12, 30), new DateTime(9998, 12, 31)), new DateTime(9998, 12, 30), new DateTime(9998, 12, 31) };
2127
yield return new object[] { new
SelectionRange
(new DateTime(9998, 12, 31), new DateTime(9998, 12, 31)), new DateTime(9998, 12, 31), new DateTime(9998, 12, 31) };
2128
yield return new object[] { new
SelectionRange
(new DateTime(9998, 12, 31).AddTicks(1), new DateTime(9998, 12, 31).AddTicks(1)), new DateTime(9998, 12, 31), new DateTime(9998, 12, 31) };
2129
yield return new object[] { new
SelectionRange
(DateTime.MaxValue, DateTime.MaxValue), DateTime.MaxValue.Date, DateTime.MaxValue.Date };
2148
calendar.SelectionRange = new
SelectionRange
(expectedSelectionStart, expectedSelectionEnd);
2182
calendar.SelectionRange = new
SelectionRange
(expectedSelectionStart, expectedSelectionEnd);
2198
calendar.SelectionRange = new
SelectionRange
(calendar.MinDate.AddTicks(-1), calendar.MinDate);
2202
calendar.SelectionRange = new
SelectionRange
(calendar.MinDate, calendar.MinDate.AddTicks(-1));
2207
Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new
SelectionRange
(calendar.MinDate.AddTicks(-1), calendar.MinDate));
2208
Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new
SelectionRange
(calendar.MinDate, calendar.MinDate.AddTicks(-1)));
2215
calendar.SelectionRange = new
SelectionRange
(calendar.MaxDate.AddTicks(1), calendar.MaxDate);
2219
calendar.SelectionRange = new
SelectionRange
(calendar.MaxDate, calendar.MaxDate.AddTicks(1));
2224
Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new
SelectionRange
(calendar.MaxDate.AddDays(1), calendar.MaxDate));
2225
Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new
SelectionRange
(calendar.MaxDate, calendar.MaxDate.AddDays(1)));
4250
SelectionRange originalRange =
new
(startDate, endDate);
4386
cellAccessibleObject.TestAccessor().Dynamic._dateRange = new
SelectionRange
(startDate, endDate);