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)
126yield return new object[] { 0, new SelectionRange(new DateTime(2020, 12, 27), new DateTime(2021, 1, 31)) }; 127yield return new object[] { 1, new SelectionRange(new DateTime(2021, 2, 1), new DateTime(2021, 2, 28)) }; 128yield return new object[] { 2, new SelectionRange(new DateTime(2021, 3, 1), new DateTime(2021, 3, 31)) }; 129yield return new object[] { 3, new SelectionRange(new DateTime(2021, 4, 1), new DateTime(2021, 4, 30)) }; 130yield return new object[] { 4, new SelectionRange(new DateTime(2021, 5, 1), new DateTime(2021, 5, 31)) }; 131yield return new object[] { 5, new SelectionRange(new DateTime(2021, 6, 1), new DateTime(2021, 7, 10)) };
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (3)
15private readonly SelectionRange _range = new(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31)); 97SelectionRange range = new(start, end); 156SelectionRange range = new SelectionRange(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (34)
1027SelectionRange = new SelectionRange(lower, upper) 2109yield return new object[] { new SelectionRange(DateTime.MinValue, DateTime.MinValue), DateTime.MinValue, DateTime.MinValue }; 2110yield 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) }; 2111yield 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) }; 2112yield 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) }; 2114yield 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) }; 2115yield 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) }; 2116yield 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) }; 2117yield 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) }; 2118yield 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) }; 2119yield 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) }; 2121yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date }; 2122yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(1)), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) }; 2123yield return new object[] { new SelectionRange(DateTime.Now.Date.AddHours(1), DateTime.Now.Date.AddHours(1)), DateTime.Now.Date, DateTime.Now.Date }; 2124yield return new object[] { new SelectionRange(DateTime.Now.Date.AddDays(1), DateTime.Now.Date), DateTime.Now.Date, DateTime.Now.Date.AddDays(1) }; 2125yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(6)), DateTime.Now.Date, DateTime.Now.Date.AddDays(6) }; 2126yield return new object[] { new SelectionRange(DateTime.Now.Date, DateTime.Now.Date.AddDays(7)), DateTime.Now.Date.AddDays(1), DateTime.Now.Date.AddDays(7) }; 2128yield 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) }; 2129yield 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) }; 2130yield 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) }; 2131yield return new object[] { new SelectionRange(DateTime.MaxValue, DateTime.MaxValue), DateTime.MaxValue.Date, DateTime.MaxValue.Date }; 2150calendar.SelectionRange = new SelectionRange(expectedSelectionStart, expectedSelectionEnd); 2184calendar.SelectionRange = new SelectionRange(expectedSelectionStart, expectedSelectionEnd); 2200calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate); 2204calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1)); 2209Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate.AddTicks(-1), calendar.MinDate)); 2210Assert.Throws<ArgumentOutOfRangeException>("date1", () => calendar.SelectionRange = new SelectionRange(calendar.MinDate, calendar.MinDate.AddTicks(-1))); 2217calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddTicks(1), calendar.MaxDate); 2221calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddTicks(1)); 2226Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate.AddDays(1), calendar.MaxDate)); 2227Assert.Throws<ArgumentOutOfRangeException>("date2", () => calendar.SelectionRange = new SelectionRange(calendar.MaxDate, calendar.MaxDate.AddDays(1))); 4252SelectionRange originalRange = new(startDate, endDate); 4253SelectionRange copiedRange = new(originalRange); 4388cellAccessibleObject.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)
136public void CalendarAccessibleObject_DateRange_IsExpected_ForSpecificCalendar_InMonthView(int calendarIndex, SelectionRange expected)
System\Windows\Forms\AccessibleObjects\MonthCalendar.MonthCalendarAccessibleObjectTests.cs (4)
200SelectionRange expected = monthCalendar.GetDisplayRange(visible); 201SelectionRange actual = accessibleObject.GetDisplayRange(visible); 377SelectionRange expected = monthCalendar.SelectionRange; 378SelectionRange actual = accessibleObject.SelectionRange;
System\Windows\Forms\MonthCalendar.SelectionRangeConverterTests.cs (12)
15private readonly SelectionRange _range = new(new DateTime(2022, 1, 1), new DateTime(2022, 12, 31)); 59SelectionRange range = (SelectionRange)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value); 69SelectionRange range = (SelectionRange)_converter.ConvertFrom(null, CultureInfo.InvariantCulture, value); 97SelectionRange range = new(start, end); 108SelectionRange result = (SelectionRange)descriptor.Invoke(); 134Func<SelectionRange> func = () => (SelectionRange)_converter.CreateInstance(null, propertyValues); 141SelectionRange range = func(); 156SelectionRange range = new SelectionRange(DateTime.Now, DateTime.Now.AddDays(1));
System\Windows\Forms\MonthCalendarTests.cs (5)
2136public void MonthCalendar_SelectionRange_Set_GetReturnsExpected(SelectionRange value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd) 2161public void MonthCalendar_SelectionRange_SetWithHandle_GetReturnsExpected(SelectionRange value, DateTime expectedSelectionStart, DateTime expectedSelectionEnd) 4197SelectionRange displayRange = calendar.GetDisplayRange(visible: false); 4252SelectionRange originalRange = new(startDate, endDate); 4253SelectionRange copiedRange = new(originalRange);