System\Windows\Forms\Accessibility\AccessibleRoleControlTypeMap.cs (68)
13private static readonly Dictionary<AccessibleRole, UIA_CONTROLTYPE_ID> s_map = new()
15{ AccessibleRole.Alert, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
16{ AccessibleRole.Animation, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
17{ AccessibleRole.Application, UIA_CONTROLTYPE_ID.UIA_WindowControlTypeId },
18{ AccessibleRole.Border, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
19{ AccessibleRole.ButtonDropDown, UIA_CONTROLTYPE_ID.UIA_SplitButtonControlTypeId },
20{ AccessibleRole.ButtonDropDownGrid, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId },
21{ AccessibleRole.ButtonMenu, UIA_CONTROLTYPE_ID.UIA_MenuItemControlTypeId },
22{ AccessibleRole.Caret, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
23{ AccessibleRole.Cell, UIA_CONTROLTYPE_ID.UIA_DataItemControlTypeId },
24{ AccessibleRole.Character, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
25{ AccessibleRole.Chart, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
26{ AccessibleRole.CheckButton, UIA_CONTROLTYPE_ID.UIA_CheckBoxControlTypeId },
27{ AccessibleRole.Client, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
28{ AccessibleRole.Clock, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId },
29{ AccessibleRole.Column, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
30{ AccessibleRole.ColumnHeader, UIA_CONTROLTYPE_ID.UIA_HeaderControlTypeId },
31{ AccessibleRole.ComboBox, UIA_CONTROLTYPE_ID.UIA_ComboBoxControlTypeId },
32{ AccessibleRole.Cursor, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
33{ AccessibleRole.Default, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
34{ AccessibleRole.Diagram, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
35{ AccessibleRole.Dial, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
36{ AccessibleRole.Dialog, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
37{ AccessibleRole.Document, UIA_CONTROLTYPE_ID.UIA_DocumentControlTypeId },
38{ AccessibleRole.DropList, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
39{ AccessibleRole.Equation, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
40{ AccessibleRole.Graphic, UIA_CONTROLTYPE_ID.UIA_ImageControlTypeId },
41{ AccessibleRole.Grip, UIA_CONTROLTYPE_ID.UIA_ThumbControlTypeId },
42{ AccessibleRole.Grouping, UIA_CONTROLTYPE_ID.UIA_GroupControlTypeId },
43{ AccessibleRole.HelpBalloon, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
44{ AccessibleRole.HotkeyField, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
45{ AccessibleRole.Indicator, UIA_CONTROLTYPE_ID.UIA_ThumbControlTypeId },
46{ AccessibleRole.IpAddress, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
47{ AccessibleRole.Link, UIA_CONTROLTYPE_ID.UIA_HyperlinkControlTypeId },
48{ AccessibleRole.List, UIA_CONTROLTYPE_ID.UIA_ListControlTypeId },
49{ AccessibleRole.ListItem, UIA_CONTROLTYPE_ID.UIA_ListItemControlTypeId },
50{ AccessibleRole.MenuBar, UIA_CONTROLTYPE_ID.UIA_MenuBarControlTypeId },
51{ AccessibleRole.MenuItem, UIA_CONTROLTYPE_ID.UIA_MenuItemControlTypeId },
52{ AccessibleRole.MenuPopup, UIA_CONTROLTYPE_ID.UIA_MenuControlTypeId },
53{ AccessibleRole.None, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
54{ AccessibleRole.Outline, UIA_CONTROLTYPE_ID.UIA_TreeControlTypeId },
55{ AccessibleRole.OutlineButton, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
56{ AccessibleRole.OutlineItem, UIA_CONTROLTYPE_ID.UIA_TreeItemControlTypeId },
57{ AccessibleRole.PageTab, UIA_CONTROLTYPE_ID.UIA_TabItemControlTypeId },
58{ AccessibleRole.PageTabList, UIA_CONTROLTYPE_ID.UIA_TabControlTypeId },
59{ AccessibleRole.Pane, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
60{ AccessibleRole.ProgressBar, UIA_CONTROLTYPE_ID.UIA_ProgressBarControlTypeId },
61{ AccessibleRole.PropertyPage, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
62{ AccessibleRole.PushButton, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId },
63{ AccessibleRole.RadioButton, UIA_CONTROLTYPE_ID.UIA_RadioButtonControlTypeId },
64{ AccessibleRole.Row, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
65{ AccessibleRole.RowHeader, UIA_CONTROLTYPE_ID.UIA_HeaderControlTypeId },
66{ AccessibleRole.ScrollBar, UIA_CONTROLTYPE_ID.UIA_ScrollBarControlTypeId },
67{ AccessibleRole.Separator, UIA_CONTROLTYPE_ID.UIA_SeparatorControlTypeId },
68{ AccessibleRole.Slider, UIA_CONTROLTYPE_ID.UIA_SliderControlTypeId },
69{ AccessibleRole.Sound, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
70{ AccessibleRole.SpinButton, UIA_CONTROLTYPE_ID.UIA_SpinnerControlTypeId },
71{ AccessibleRole.SplitButton, UIA_CONTROLTYPE_ID.UIA_SplitButtonControlTypeId },
72{ AccessibleRole.StaticText, UIA_CONTROLTYPE_ID.UIA_TextControlTypeId },
73{ AccessibleRole.StatusBar, UIA_CONTROLTYPE_ID.UIA_StatusBarControlTypeId },
74{ AccessibleRole.Table, UIA_CONTROLTYPE_ID.UIA_TableControlTypeId },
75{ AccessibleRole.Text, UIA_CONTROLTYPE_ID.UIA_EditControlTypeId },
76{ AccessibleRole.TitleBar, UIA_CONTROLTYPE_ID.UIA_TitleBarControlTypeId },
77{ AccessibleRole.ToolBar, UIA_CONTROLTYPE_ID.UIA_ToolBarControlTypeId },
78{ AccessibleRole.ToolTip, UIA_CONTROLTYPE_ID.UIA_ToolTipControlTypeId },
79{ AccessibleRole.WhiteSpace, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId },
80{ AccessibleRole.Window, UIA_CONTROLTYPE_ID.UIA_WindowControlTypeId }
83public static UIA_CONTROLTYPE_ID GetControlType(AccessibleRole role) => s_map[role];
System\Windows\Forms\AccessibleRoleControlTypeMapTests.cs (71)
28UIA_CONTROLTYPE_ID actual = AccessibleRoleControlTypeMap.GetControlType(role);
30Assert.True(actual is >= UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId and <= UIA_CONTROLTYPE_ID.UIA_AppBarControlTypeId);
43yield return new object[] { AccessibleRole.Alert, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
44yield return new object[] { AccessibleRole.Animation, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
45yield return new object[] { AccessibleRole.Application, UIA_CONTROLTYPE_ID.UIA_WindowControlTypeId };
46yield return new object[] { AccessibleRole.Border, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
47yield return new object[] { AccessibleRole.ButtonDropDown, UIA_CONTROLTYPE_ID.UIA_SplitButtonControlTypeId };
48yield return new object[] { AccessibleRole.ButtonDropDownGrid, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId };
49yield return new object[] { AccessibleRole.ButtonMenu, UIA_CONTROLTYPE_ID.UIA_MenuItemControlTypeId };
50yield return new object[] { AccessibleRole.Caret, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
51yield return new object[] { AccessibleRole.Cell, UIA_CONTROLTYPE_ID.UIA_DataItemControlTypeId };
52yield return new object[] { AccessibleRole.Character, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
53yield return new object[] { AccessibleRole.Chart, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
54yield return new object[] { AccessibleRole.CheckButton, UIA_CONTROLTYPE_ID.UIA_CheckBoxControlTypeId };
55yield return new object[] { AccessibleRole.Client, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
56yield return new object[] { AccessibleRole.Clock, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId };
57yield return new object[] { AccessibleRole.Column, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
58yield return new object[] { AccessibleRole.ColumnHeader, UIA_CONTROLTYPE_ID.UIA_HeaderControlTypeId };
59yield return new object[] { AccessibleRole.ComboBox, UIA_CONTROLTYPE_ID.UIA_ComboBoxControlTypeId };
60yield return new object[] { AccessibleRole.Cursor, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
61yield return new object[] { AccessibleRole.Default, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
62yield return new object[] { AccessibleRole.Diagram, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
63yield return new object[] { AccessibleRole.Dial, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
64yield return new object[] { AccessibleRole.Dialog, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
65yield return new object[] { AccessibleRole.Document, UIA_CONTROLTYPE_ID.UIA_DocumentControlTypeId };
66yield return new object[] { AccessibleRole.DropList, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
67yield return new object[] { AccessibleRole.Equation, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
68yield return new object[] { AccessibleRole.Graphic, UIA_CONTROLTYPE_ID.UIA_ImageControlTypeId };
69yield return new object[] { AccessibleRole.Grip, UIA_CONTROLTYPE_ID.UIA_ThumbControlTypeId };
70yield return new object[] { AccessibleRole.Grouping, UIA_CONTROLTYPE_ID.UIA_GroupControlTypeId };
71yield return new object[] { AccessibleRole.HelpBalloon, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
72yield return new object[] { AccessibleRole.HotkeyField, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
73yield return new object[] { AccessibleRole.Indicator, UIA_CONTROLTYPE_ID.UIA_ThumbControlTypeId };
74yield return new object[] { AccessibleRole.IpAddress, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
75yield return new object[] { AccessibleRole.Link, UIA_CONTROLTYPE_ID.UIA_HyperlinkControlTypeId };
76yield return new object[] { AccessibleRole.List, UIA_CONTROLTYPE_ID.UIA_ListControlTypeId };
77yield return new object[] { AccessibleRole.ListItem, UIA_CONTROLTYPE_ID.UIA_ListItemControlTypeId };
78yield return new object[] { AccessibleRole.MenuBar, UIA_CONTROLTYPE_ID.UIA_MenuBarControlTypeId };
79yield return new object[] { AccessibleRole.MenuItem, UIA_CONTROLTYPE_ID.UIA_MenuItemControlTypeId };
80yield return new object[] { AccessibleRole.MenuPopup, UIA_CONTROLTYPE_ID.UIA_MenuControlTypeId };
81yield return new object[] { AccessibleRole.None, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
82yield return new object[] { AccessibleRole.Outline, UIA_CONTROLTYPE_ID.UIA_TreeControlTypeId };
83yield return new object[] { AccessibleRole.OutlineButton, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
84yield return new object[] { AccessibleRole.OutlineItem, UIA_CONTROLTYPE_ID.UIA_TreeItemControlTypeId };
85yield return new object[] { AccessibleRole.PageTab, UIA_CONTROLTYPE_ID.UIA_TabItemControlTypeId };
86yield return new object[] { AccessibleRole.PageTabList, UIA_CONTROLTYPE_ID.UIA_TabControlTypeId };
87yield return new object[] { AccessibleRole.Pane, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
88yield return new object[] { AccessibleRole.ProgressBar, UIA_CONTROLTYPE_ID.UIA_ProgressBarControlTypeId };
89yield return new object[] { AccessibleRole.PropertyPage, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
90yield return new object[] { AccessibleRole.PushButton, UIA_CONTROLTYPE_ID.UIA_ButtonControlTypeId };
91yield return new object[] { AccessibleRole.RadioButton, UIA_CONTROLTYPE_ID.UIA_RadioButtonControlTypeId };
92yield return new object[] { AccessibleRole.Row, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
93yield return new object[] { AccessibleRole.RowHeader, UIA_CONTROLTYPE_ID.UIA_HeaderControlTypeId };
94yield return new object[] { AccessibleRole.ScrollBar, UIA_CONTROLTYPE_ID.UIA_ScrollBarControlTypeId };
95yield return new object[] { AccessibleRole.Separator, UIA_CONTROLTYPE_ID.UIA_SeparatorControlTypeId };
96yield return new object[] { AccessibleRole.Slider, UIA_CONTROLTYPE_ID.UIA_SliderControlTypeId };
97yield return new object[] { AccessibleRole.Sound, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
98yield return new object[] { AccessibleRole.SpinButton, UIA_CONTROLTYPE_ID.UIA_SpinnerControlTypeId };
99yield return new object[] { AccessibleRole.SplitButton, UIA_CONTROLTYPE_ID.UIA_SplitButtonControlTypeId };
100yield return new object[] { AccessibleRole.StaticText, UIA_CONTROLTYPE_ID.UIA_TextControlTypeId };
101yield return new object[] { AccessibleRole.StatusBar, UIA_CONTROLTYPE_ID.UIA_StatusBarControlTypeId };
102yield return new object[] { AccessibleRole.Table, UIA_CONTROLTYPE_ID.UIA_TableControlTypeId };
103yield return new object[] { AccessibleRole.Text, UIA_CONTROLTYPE_ID.UIA_EditControlTypeId };
104yield return new object[] { AccessibleRole.TitleBar, UIA_CONTROLTYPE_ID.UIA_TitleBarControlTypeId };
105yield return new object[] { AccessibleRole.ToolBar, UIA_CONTROLTYPE_ID.UIA_ToolBarControlTypeId };
106yield return new object[] { AccessibleRole.ToolTip, UIA_CONTROLTYPE_ID.UIA_ToolTipControlTypeId };
107yield return new object[] { AccessibleRole.WhiteSpace, UIA_CONTROLTYPE_ID.UIA_PaneControlTypeId };
108yield return new object[] { AccessibleRole.Window, UIA_CONTROLTYPE_ID.UIA_WindowControlTypeId };
117UIA_CONTROLTYPE_ID actual = AccessibleRoleControlTypeMap.GetControlType(role);
119Assert.Equal((UIA_CONTROLTYPE_ID)expectedType, actual);