35 references to HitArea
System.Windows.Forms (21)
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (15)
1157
private static
HitArea
GetHitArea(MCHITTESTINFO_HIT_FLAGS hit) => hit switch
1159
MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBK =>
HitArea
.TitleBackground,
1160
MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEMONTH =>
HitArea
.TitleMonth,
1161
MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEYEAR =>
HitArea
.TitleYear,
1162
MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBTNNEXT =>
HitArea
.NextMonthButton,
1163
MCHITTESTINFO_HIT_FLAGS.MCHT_TITLEBTNPREV =>
HitArea
.PrevMonthButton,
1164
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARBK =>
HitArea
.CalendarBackground,
1165
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATE =>
HitArea
.Date,
1166
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATENEXT =>
HitArea
.NextMonthDate,
1167
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDATEPREV =>
HitArea
.PrevMonthDate,
1168
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARDAY =>
HitArea
.DayOfWeek,
1169
MCHITTESTINFO_HIT_FLAGS.MCHT_CALENDARWEEKNUM =>
HitArea
.WeekNumbers,
1170
MCHITTESTINFO_HIT_FLAGS.MCHT_TODAYLINK =>
HitArea
.TodayLink,
1171
_ =>
HitArea
.Nowhere,
1307
HitArea
hitArea = GetHitArea(mchi.uHit);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.HitTestInfo.cs (6)
15
internal HitTestInfo(Point pt,
HitArea
area, DateTime time)
25
internal HitTestInfo(Point pt,
HitArea
area)
40
public
HitArea
HitArea { get; }
51
internal static bool HitAreaHasValidDateTime(
HitArea
hitArea) =>
55
HitArea
.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)]
15
public 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)]
33
public void HitTestInfo_HitAreaHasValidDateTime_ReturnsExpectedResult(
HitArea
hitArea, bool expectedResult)
45
HitArea
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")]
4487
public void MonthCalendar_HitTest_ReturnsExpected(int x, int y,
HitArea
expectedHitArea, string expectedTimeString)