@@ -13,69 +13,220 @@ namespace TestStack.White.UIItems
13
13
{
14
14
public interface IUIItem : IActionListener
15
15
{
16
+ #region Automation
17
+
16
18
/// <summary>
17
19
/// Should be used only if white doesn't support the feature you are looking for.
18
20
/// Knowledge of UIAutomation would be required. It would better idea to also raise an issue if you are using it.
19
21
/// </summary>
20
22
AutomationElement AutomationElement { get ; }
21
23
22
- bool Enabled { get ; }
24
+ /// <summary>
25
+ /// The <see cref="WindowsFramework"/> of the UI Item
26
+ /// </summary>
23
27
WindowsFramework Framework { get ; }
24
- Point Location { get ; }
25
- Rect Bounds { get ; }
28
+
29
+ /// <summary>
30
+ /// The <see cref="IActionListener"/> of the UI Item
31
+ /// </summary>
32
+ IActionListener ActionListener { get ; }
33
+
34
+ /// <summary>
35
+ /// Uses the Raw View provided by UIAutomation to find elements within this UIItem.
36
+ /// RawView sometimes contains extra AutomationElements.
37
+ /// This is internal to white although made public.
38
+ /// Should be used only if the standard approaches dont work.
39
+ /// Also if you end up using it please raise an issue so that it can be fixed.
40
+ /// Please understand that calling this method on any UIItem,
41
+ /// which has a lot of child AutomationElements might result in very bad performance.
42
+ /// </summary>
43
+ /// <param name="searchCriteria"></param>
44
+ /// <returns>null or found AutomationElement</returns>
45
+ AutomationElement GetElement ( SearchCriteria searchCriteria ) ;
46
+
47
+ #endregion
48
+
49
+ #region State Properties
50
+
51
+ /// <summary>
52
+ /// Is UI Item Enabled
53
+ /// </summary>
54
+ bool Enabled { get ; }
55
+
56
+ /// <summary>
57
+ /// Is UI Item Off Screen
58
+ /// </summary>
59
+ bool IsOffScreen { get ; }
60
+
61
+ /// <summary>
62
+ /// Is UI Item Visible
63
+ /// </summary>
64
+ bool Visible { get ; }
65
+
66
+ /// <summary>
67
+ /// Is UI Item Focussed
68
+ /// </summary>
69
+ bool IsFocussed { get ; }
70
+
71
+ /// <summary>
72
+ /// The Status of the UI Item
73
+ /// </summary>
74
+ string ItemStatus { get ; }
75
+
76
+ /// <summary>
77
+ /// Name of the UI Item
78
+ /// </summary>
26
79
string Name { get ; }
27
- Point ClickablePoint { get ; }
28
- string AccessKey { get ; }
80
+
81
+ /// <summary>
82
+ /// ID of the UI Item
83
+ /// </summary>
29
84
string Id { get ; }
30
- bool Visible { get ; }
85
+
86
+ /// <summary>
87
+ /// Primary Identification of the UI Item
88
+ /// </summary>
31
89
string PrimaryIdentification { get ; }
32
- IActionListener ActionListener { get ; }
90
+
91
+ /// <summary>
92
+ /// Access Key of the UI Item
93
+ /// </summary>
94
+ string AccessKey { get ; }
95
+
96
+ /// <summary>
97
+ /// HelpText of the UI Item
98
+ /// </summary>
99
+ string HelpText { get ; }
100
+
101
+ /// <summary>
102
+ /// <see cref="IScrollBars"/> of the UI Item
103
+ /// </summary>
33
104
IScrollBars ScrollBars { get ; }
34
- bool IsOffScreen { get ; }
35
- bool IsFocussed { get ; }
105
+
106
+ #endregion
107
+
108
+ #region Dimension Properties
109
+
110
+ /// <summary>
111
+ /// <see cref="Point"/> location of the UI Item
112
+ /// </summary>
113
+ Point Location { get ; }
114
+
115
+ /// <summary>
116
+ /// <see cref="Rect"/> Bounds of the UI Item
117
+ /// </summary>
118
+ Rect Bounds { get ; }
119
+
120
+ /// <summary>
121
+ /// <see cref="Point"/> ClickablePoint of the UI Item
122
+ /// </summary>
123
+ Point ClickablePoint { get ; }
124
+
125
+ #endregion
126
+
127
+ #region Graphics
128
+
129
+ /// <summary>
130
+ /// <see cref="Color"/> of the UI Item Border
131
+ /// </summary>
36
132
Color BorderColor { get ; }
133
+
134
+ /// <summary>
135
+ /// <see cref="Bitmap"/> representing the VisibleImage of the UI Item
136
+ /// </summary>
37
137
Bitmap VisibleImage { get ; }
38
- bool ValueOfEquals ( AutomationProperty property , object compareTo ) ;
39
- void RightClickAt ( Point point ) ;
40
- void RightClick ( ) ;
138
+
139
+ /// <summary>
140
+ /// Draw a Highlighting around the UI Item in the Color <see cref="Color.Red"/>
141
+ /// </summary>
142
+ void DrawHighlight ( ) ;
143
+
144
+ /// <summary>
145
+ /// Draw a Highlighting around the UI Item in a specific color
146
+ /// </summary>
147
+ /// <param name="color">Color of the Highlighting</param>
148
+ void DrawHighlight ( Color color ) ;
149
+
150
+ /// <summary>
151
+ /// Capture a <see cref="Bitmap"/> image of the UI Item
152
+ /// </summary>
153
+ Bitmap Capture ( ) ;
154
+
155
+ #endregion
156
+
157
+ #region Interaction
158
+
159
+ /// <summary>
160
+ /// Focus the UI Item
161
+ /// </summary>
41
162
void Focus ( ) ;
42
163
43
164
/// <summary>
44
- /// An alternative to use instead of Focus, might sometimes be more reliable
165
+ /// Bring the UI Item to the Foreground
45
166
/// </summary>
167
+ /// <remarks>
168
+ /// An alternative to use instead of Focus, might sometimes be more reliable
169
+ /// </remarks>
46
170
void SetForeground ( ) ;
47
-
171
+
172
+ /// <summary>
173
+ /// Visit the UI Item
174
+ /// </summary>
175
+ /// <param name="windowControlVisitor">Window Control Visitor</param>
48
176
void Visit ( IWindowControlVisitor windowControlVisitor ) ;
49
177
50
178
/// <summary>
51
- /// Provides the Error on this UIItem.
52
- /// This would return Error object when this item has ErrorProvider displayed next to it.
179
+ /// Performs an Invoke on the <see cref="InvokePattern"/> Pattern of the UI Item
53
180
/// </summary>
54
- /// <param name="window"></param >
55
- /// <returns></returns>
56
- string ErrorProviderMessage ( Window window ) ;
57
-
58
- bool NameMatches ( string text ) ;
181
+ /// <remarks >
182
+ /// This is faster then a <see cref="Click()"/> on the UI Item.
183
+ /// Can have some side effects that certain Click Events are bypassed.
184
+ /// </remarks>
185
+ void Invoke ( ) ;
59
186
60
187
/// <summary>
61
- /// Performs mouse click at the center of this item
188
+ /// Performs mouse click at the center of the UI Item
62
189
/// </summary>
63
190
void Click ( ) ;
64
191
65
192
/// <summary>
66
- /// Performs mouse double click at the center of this item
193
+ /// Performs mouse double click at the center of the UI Item
67
194
/// </summary>
68
195
void DoubleClick ( ) ;
69
196
70
197
/// <summary>
71
- ///Perform keyboard action on this UIItem
198
+ /// Performs a right mouse click at the center of the UI Item
199
+ /// </summary>
200
+ void RightClick ( ) ;
201
+
202
+ /// <summary>
203
+ /// Performas a right mouse click at a defined <remarks>Point</remarks>
204
+ /// </summary>
205
+ /// <param name="point">Point to mouse right click</param>
206
+ void RightClickAt ( Point point ) ;
207
+
208
+ /// <summary>
209
+ ///Perform keyboard action on this UI Item
72
210
/// </summary>
73
211
/// <param name="key"></param>
74
212
void KeyIn ( KeyboardInput . SpecialKeys key ) ;
75
213
76
- bool Equals ( object obj ) ;
77
- int GetHashCode ( ) ;
78
- string ToString ( ) ;
214
+ /// <summary>
215
+ /// Sets a value on this UI Item
216
+ /// </summary>
217
+ /// <param name="value">Value to set</param>
218
+ void SetValue ( object value ) ;
219
+
220
+ /// <summary>
221
+ /// Enter a value on this UI Item
222
+ /// </summary>
223
+ /// <param name="value">Value to enter</param>
224
+ /// <remarks>The <see cref="ValuePattern"/> must be supported by the UI Item for this to work</remarks>
225
+ void Enter ( string value ) ;
226
+
227
+ #endregion
228
+
229
+ #region Recording
79
230
80
231
/// <summary>
81
232
/// Internal to white and intended to be used for white recording
@@ -86,32 +237,63 @@ public interface IUIItem : IActionListener
86
237
/// Internal to white and intended to be used for white recording
87
238
/// </summary>
88
239
/// <param name="eventListener"></param>
89
- void HookEvents ( UIItemEventListener eventListener ) ;
240
+ void HookEvents ( IUIItemEventListener eventListener ) ;
90
241
91
- void SetValue ( object value ) ;
242
+ #endregion
243
+
244
+ #region Debugging
245
+
246
+ /// <summary>
247
+ /// Provides the Error on this UIItem.
248
+ /// This would return Error object when this item has ErrorProvider displayed next to it.
249
+ /// </summary>
250
+ /// <param name="window"></param>
251
+ /// <returns></returns>
252
+ string ErrorProviderMessage ( Window window ) ;
253
+
254
+ /// <summary>
255
+ /// Log Structure of the UI Item
256
+ /// </summary>
92
257
void LogStructure ( ) ;
93
258
259
+ #endregion
260
+
261
+ #region Equality
262
+
94
263
/// <summary>
95
- /// Uses the Raw View provided by UIAutomation to find elements within this UIItem.
96
- /// RawView sometimes contains extra AutomationElements.
97
- /// This is internal to white although made public.
98
- /// Should be used only if the standard approaches dont work.
99
- /// Also if you end up using it please raise an issue so that it can be fixed.
100
- /// Please understand that calling this method on any UIItem,
101
- /// which has a lot of child AutomationElements might result in very bad performance.
264
+ /// Check if the UI Item name matches a given name
102
265
/// </summary>
103
- /// <param name="searchCriteria"> </param>
104
- /// <returns>null or found AutomationElement </returns>
105
- AutomationElement GetElement ( SearchCriteria searchCriteria ) ;
266
+ /// <param name="text">Name Value to match against </param>
267
+ /// <returns>Returns <c>true</c> if matches, else <c>false</c> </returns>
268
+ bool NameMatches ( string text ) ;
106
269
107
- void Enter ( string value ) ;
270
+ /// <summary>
271
+ /// Compare the <see cref="AutomationProperty"/> from the UI Item against an object
272
+ /// </summary>
273
+ /// <param name="property">The <see cref="AutomationProperty"/> value to compare to</param>
274
+ /// <param name="compareTo">The object to compare it to</param>
275
+ /// <returns>Returns <c>true</c> if matches, else <c>false</c></returns>
276
+ bool ValueOfEquals ( AutomationProperty property , object compareTo ) ;
108
277
109
- void DrawHighlight ( ) ;
110
- void DrawHighlight ( Color color ) ;
278
+ /// <summary>
279
+ /// CHeck if the UI Item equals an object
280
+ /// </summary>
281
+ /// <param name="obj">Object to compare to</param>
282
+ /// <returns>Returns <c>true</c> if matches, else <c>false</c></returns>
283
+ bool Equals ( object obj ) ;
111
284
112
285
/// <summary>
113
- /// Captures an image of the element
286
+ /// Get the HashCode of the UI Item
114
287
/// </summary>
115
- Bitmap Capture ( ) ;
288
+ /// <returns>The HashCode of the UI Item</returns>
289
+ int GetHashCode ( ) ;
290
+
291
+ /// <summary>
292
+ /// ToString overload for the UI Item
293
+ /// </summary>
294
+ /// <returns>The String representation of the UI Item</returns>
295
+ string ToString ( ) ;
296
+
297
+ #endregion
116
298
}
117
299
}
0 commit comments