50 instantiations of SelectionRange
System.Windows.Forms (7)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (2)
712
get =>
new
(SelectionStart, SelectionEnd);
1257
return new
SelectionRange
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
545
internal SelectionRange SelectionRange => this.TryGetOwnerAs(out MonthCalendar? owner) ? owner.SelectionRange : new
SelectionRange
();
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 (43)
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 (34)
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);
4251
SelectionRange copiedRange =
new
(originalRange);
4386
cellAccessibleObject.TestAccessor().Dynamic._dateRange = new
SelectionRange
(startDate, endDate);
50 references to SelectionRange
System.Windows.Forms (28)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarAccessibleObject.cs (4)
27
private
SelectionRange
? _dateRange;
69
internal
SelectionRange
? DateRange
75
SelectionRange
? dateRange = _monthCalendarAccessibleObject.GetCalendarPartDateRange(MCGRIDINFO_PART.MCGIP_CALENDAR, _calendarIndex);
82
SelectionRange
? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(false);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarCellAccessibleObject.cs (2)
30
private
SelectionRange
? _dateRange;
62
internal virtual
SelectionRange
? DateRange
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarDayOfWeekCellAccessibleObject.cs (1)
33
internal override
SelectionRange
? DateRange => null;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarNextButtonAccessibleObject.cs (1)
68
SelectionRange
? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(true);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarPreviousButtonAccessibleObject.cs (1)
58
SelectionRange
? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(true);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarWeekNumberCellAccessibleObject.cs (1)
38
internal override
SelectionRange
? DateRange => null;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (9)
108
private
SelectionRange
? _currentDisplayRange;
338
internal void FillMonthDayStates(Span<uint> monthDayStates,
SelectionRange
displayRange)
710
public
SelectionRange
SelectionRange
1088
SelectionRange
range = GetDisplayRange(visible: false);
1144
public
SelectionRange
GetDisplayRange(bool visible)
1253
private
SelectionRange
GetMonthRange(uint flag)
1269
private static int GetMonthsCountOfRange(
SelectionRange
displayRange)
1813
SelectionRange
displayRange = GetDisplayRange(false);
1978
SelectionRange
newRange = GetDisplayRange(false);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (5)
235
internal unsafe
SelectionRange
? GetCalendarPartDateRange(MCGRIDINFO_PART dwPart, int calendarIndex = 0, int rowIndex = 0, int columnIndex = 0)
357
SelectionRange
? cellRange = cell.DateRange;
376
internal
SelectionRange
? GetDisplayRange(bool visible)
545
internal
SelectionRange
SelectionRange => this.TryGetOwnerAs(out MonthCalendar? owner) ? owner.SelectionRange : new SelectionRange();
572
SelectionRange
? range;
System\Windows\Forms\Controls\MonthCalendar\SelectionRange.cs (1)
56
public SelectionRange(
SelectionRange
range)
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (3)
96
if (value is
SelectionRange
range)
122
ConstructorInfo? ctor = typeof(
SelectionRange
).GetConstructor(
175
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(
SelectionRange
), attributes);
System.Windows.Forms.Tests (22)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (1)
134
public void CalendarAccessibleObject_DateRange_IsExpected_ForSpecificCalendar_InMonthView(int calendarIndex,
SelectionRange
expected)
System\Windows\Forms\AccessibleObjects\MonthCalendar.MonthCalendarAccessibleObjectTests.cs (4)
198
SelectionRange
expected = monthCalendar.GetDisplayRange(visible);
199
SelectionRange
actual = accessibleObject.GetDisplayRange(visible);
375
SelectionRange
expected = monthCalendar.SelectionRange;
376
SelectionRange
actual = accessibleObject.SelectionRange;
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (12)
13
private readonly
SelectionRange
_range = new(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31));
57
SelectionRange
range = (
SelectionRange
)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value);
67
SelectionRange
range = (
SelectionRange
)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value);
95
SelectionRange
range = new(start, end);
106
SelectionRange
result = (
SelectionRange
)descriptor.Invoke();
132
Func<
SelectionRange
> func = () => (
SelectionRange
)_converter.CreateInstance(null, propertyValues);
139
SelectionRange
range = func();
154
SelectionRange
range = new SelectionRange(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (5)
2134
public void MonthCalendar_SelectionRange_Set_GetReturnsExpected(
SelectionRange
value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd)
2159
public void MonthCalendar_SelectionRange_SetWithHandle_GetReturnsExpected(
SelectionRange
value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd)
4195
SelectionRange
displayRange = calendar.GetDisplayRange(visible: false);
4250
SelectionRange
originalRange = new(startDate, endDate);
4251
SelectionRange
copiedRange = new(originalRange);