50 instantiations of SelectionRange
System.Windows.Forms (7)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (2)
712get => new(SelectionStart, SelectionEnd); 1257return new SelectionRange
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
545internal SelectionRange SelectionRange => this.TryGetOwnerAs(out MonthCalendar? owner) ? owner.SelectionRange : new SelectionRange();
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (4)
57return new SelectionRange(DateTime.Now.Date, DateTime.Now.Date); 68return new SelectionRange(values[0], values[1]); 79return new SelectionRange(dt, dt); 145return new SelectionRange((DateTime)propertyValues["Start"]!,
System.Windows.Forms.Tests (43)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (6)
124yield return new object[] { 0, new SelectionRange(new DateTime(2020, 12, 27), new DateTime(2021, 1, 31)) }; 125yield return new object[] { 1, new SelectionRange(new DateTime(2021, 2, 1), new DateTime(2021, 2, 28)) }; 126yield return new object[] { 2, new SelectionRange(new DateTime(2021, 3, 1), new DateTime(2021, 3, 31)) }; 127yield return new object[] { 3, new SelectionRange(new DateTime(2021, 4, 1), new DateTime(2021, 4, 30)) }; 128yield return new object[] { 4, new SelectionRange(new DateTime(2021, 5, 1), new DateTime(2021, 5, 31)) }; 129yield return new object[] { 5, new SelectionRange(new DateTime(2021, 6, 1), new DateTime(2021, 7, 10)) };
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (3)
13private readonly SelectionRange _range = new(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31)); 95SelectionRange range = new(start, end); 154SelectionRange range = new SelectionRange(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (34)
1025SelectionRange = new SelectionRange(lower, upper) 2107yield return new object[] { new SelectionRange(DateTime.MinValue, DateTime.MinValue), DateTime.MinValue, DateTime.MinValue }; 2108yield 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) }; 2109yield 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) }; 2110yield 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) }; 2112yield 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) }; 2113yield 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) }; 2114yield 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) }; 2115yield 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) }; 2116yield 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) }; 2117yield 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) }; 2119yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date }; 2120yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(1)), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) }; 2121yield return new object[] { new SelectionRange(DateTime.Now.Date.AddHours(1), DateTime.Now.Date.AddHours(1)), DateTime.Now.Date, DateTime.Now.Date }; 2122yield return new object[] { new SelectionRange(DateTime.Now.Date.AddDays(1), DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) }; 2123yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(6)), DateTime.Now.Date, DateTime.Now.Date.AddDays(6) }; 2124yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(7)), DateTime.Now.Date.AddDays(1), DateTime.Now.Date.AddDays(7) }; 2126yield 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) }; 2127yield 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) }; 2128yield 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) }; 2129yield return new object[] { new SelectionRange(DateTime.MaxValue, DateTime.MaxValue), DateTime.MaxValue.Date, DateTime.MaxValue.Date }; 2148calendar.SelectionRange = new SelectionRange(expectedSelectionStart, expectedSelectionEnd); 2182calendar.SelectionRange = new SelectionRange(expectedSelectionStart, expectedSelectionEnd); 2198calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate); 2202calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1)); 2207Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate)); 2208Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1))); 2215calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddTicks(1), calendar.MaxDate); 2219calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddTicks(1)); 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))); 4250SelectionRange originalRange = new(startDate, endDate); 4251SelectionRange copiedRange = new(originalRange); 4386cellAccessibleObject.TestAccessor().Dynamic._dateRange = new SelectionRange(startDate, endDate);
50 references to SelectionRange
System.Windows.Forms (28)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarAccessibleObject.cs (4)
27private SelectionRange? _dateRange; 69internal SelectionRange? DateRange 75SelectionRange? dateRange = _monthCalendarAccessibleObject.GetCalendarPartDateRange(MCGRIDINFO_PART.MCGIP_CALENDAR, _calendarIndex); 82SelectionRange? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(false);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarCellAccessibleObject.cs (2)
30private SelectionRange? _dateRange; 62internal virtual SelectionRange? DateRange
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarDayOfWeekCellAccessibleObject.cs (1)
33internal override SelectionRange? DateRange => null;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarNextButtonAccessibleObject.cs (1)
68SelectionRange? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(true);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarPreviousButtonAccessibleObject.cs (1)
58SelectionRange? displayRange = _monthCalendarAccessibleObject.GetDisplayRange(true);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarWeekNumberCellAccessibleObject.cs (1)
38internal override SelectionRange? DateRange => null;
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (9)
108private SelectionRange? _currentDisplayRange; 338internal void FillMonthDayStates(Span<uint> monthDayStates, SelectionRange displayRange) 710public SelectionRange SelectionRange 1088SelectionRange range = GetDisplayRange(visible: false); 1144public SelectionRange GetDisplayRange(bool visible) 1253private SelectionRange GetMonthRange(uint flag) 1269private static int GetMonthsCountOfRange(SelectionRange displayRange) 1813SelectionRange displayRange = GetDisplayRange(false); 1978SelectionRange newRange = GetDisplayRange(false);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (5)
235internal unsafe SelectionRange? GetCalendarPartDateRange(MCGRIDINFO_PART dwPart, int calendarIndex = 0, int rowIndex = 0, int columnIndex = 0) 357SelectionRange? cellRange = cell.DateRange; 376internal SelectionRange? GetDisplayRange(bool visible) 545internal SelectionRange SelectionRange => this.TryGetOwnerAs(out MonthCalendar? owner) ? owner.SelectionRange : new SelectionRange(); 572SelectionRange? range;
System\Windows\Forms\Controls\MonthCalendar\SelectionRange.cs (1)
56public SelectionRange(SelectionRange range)
System\Windows\Forms\Controls\MonthCalendar\SelectionRangeConverter.cs (3)
96if (value is SelectionRange range) 122ConstructorInfo? ctor = typeof(SelectionRange).GetConstructor( 175PropertyDescriptorCollection props = TypeDescriptor.GetProperties(typeof(SelectionRange), attributes);
System.Windows.Forms.Tests (22)
System\Windows\Forms\AccessibleObjects\MonthCalendar.CalendarAccessibleObjectTests.cs (1)
134public void CalendarAccessibleObject_DateRange_IsExpected_ForSpecificCalendar_InMonthView(int calendarIndex, SelectionRange expected)
System\Windows\Forms\AccessibleObjects\MonthCalendar.MonthCalendarAccessibleObjectTests.cs (4)
198SelectionRange expected = monthCalendar.GetDisplayRange(visible); 199SelectionRange actual = accessibleObject.GetDisplayRange(visible); 375SelectionRange expected = monthCalendar.SelectionRange; 376SelectionRange actual = accessibleObject.SelectionRange;
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (12)
13private readonly SelectionRange _range = new(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31)); 57SelectionRange range = (SelectionRange)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value); 67SelectionRange range = (SelectionRange)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value); 95SelectionRange range = new(start, end); 106SelectionRange result = (SelectionRange)descriptor.Invoke(); 132Func<SelectionRange> func = () => (SelectionRange)_converter.CreateInstance(null, propertyValues); 139SelectionRange range = func(); 154SelectionRange range = new SelectionRange(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (5)
2134public void MonthCalendar_SelectionRange_Set_GetReturnsExpected(SelectionRange value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd) 2159public void MonthCalendar_SelectionRange_SetWithHandle_GetReturnsExpected(SelectionRange value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd) 4195SelectionRange displayRange = calendar.GetDisplayRange(visible: false); 4250SelectionRange originalRange = new(startDate, endDate); 4251SelectionRange copiedRange = new(originalRange);