35 references to HitArea
System.Windows.Forms (21)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (15)
1157private static HitArea GetHitArea(MCHITTESTINFO_HIT_FLAGS hit) => hit switch 1159MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBK => HitArea.TitleBackground, 1160MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEMONTH => HitArea.TitleMonth, 1161MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEYEAR => HitArea.TitleYear, 1162MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBTNNEXT => HitArea.NextMonthButton, 1163MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBTNPREV => HitArea.PrevMonthButton, 1164MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARBK => HitArea.CalendarBackground, 1165MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATE => HitArea.Date, 1166MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATENEXT => HitArea.NextMonthDate, 1167MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATEPREV => HitArea.PrevMonthDate, 1168MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDAY => HitArea.DayOfWeek, 1169MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARWEEKNUM => HitArea.WeekNumbers, 1170MCHITTESTINFO_HIT_FLAGS.MCHT_TODAYLINK => HitArea.TodayLink, 1171_ => HitArea.Nowhere, 1307HitArea hitArea = GetHitArea(mchi.uHit);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.HitTestInfo.cs (6)
15internal HitTestInfo(Point pt, HitArea area, DateTime time) 25internal HitTestInfo(Point pt, HitArea area) 40public HitArea HitArea { get; } 51internal static bool HitAreaHasValidDateTime(HitArea hitArea) => 55HitArea.Date or HitArea.WeekNumbers => true,
System.Windows.Forms.Tests (14)
System\Windows\Forms\MonthCalendar.HitTestInfoTests.cs (10)
12[InlineData(HitArea.Date, true, "2022/01/01")] 13[InlineData(HitArea.WeekNumbers, true, "2022/01/01")] 14[InlineData(HitArea.Nowhere, false, null)] 15public void HitTestInfo_Constructor_SetsPropertiesCorrectly(HitArea hitArea, bool hasDateTime, string dateTimeStr) 30[InlineData(HitArea.Date, true)] 31[InlineData(HitArea.WeekNumbers, true)] 32[InlineData(HitArea.Nowhere, false)] 33public void HitTestInfo_HitAreaHasValidDateTime_ReturnsExpectedResult(HitArea hitArea, bool expectedResult) 45HitArea hitArea = HitArea.Date;
System\Windows\Forms\MonthCalendarTests.cs (4)
4484[InlineData(0, 0, HitArea.Nowhere, "0001-01-01T00:00:00")] 4485[InlineData(100, 100, HitArea.Date, null)] 4486[InlineData(-100, -100, HitArea.Nowhere, "0001-01-01T00:00:00")] 4487public void MonthCalendar_HitTest_ReturnsExpected(int x, int y, HitArea expectedHitArea, string expectedTimeString)