GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
Attributes.cs
1// =============================================================================
2// GPAL - Generally Positive Automation Library
3// Copyright © 2026 Software Decisions, Inc. All rights reserved.
4//
5// This file is part of GPAL.
6// Licensed under the Business Source License 1.1
7//
8// Primary development, architecture, and vision by Michael B. Vederman,
9// CEO of Software Decisions, Inc., Texas.
10//
11// Internal development maintained privately.
12// Public releases appear on GitHub: https://github.com/SoftwareDecisionsInc/GPAL.
13//
14// See LICENSE for full terms, including Additional Use Grant.
15// =============================================================================
16
17using System;
18
19namespace GenerallyPositive
20{
21 [AttributeUsage(AttributeTargets.All, Inherited = true)]
22 public class GPALAttribute : Attribute
23 {
24 public string Description { get; set; }
25 public string MethodName { get; set; } = null;
26 // where the member sits inside its attribute's menu in GPAL Studio. The attribute class is the menu and
27 // this is the path below it, a slash between levels: "Controls/Lists" under Forms is Forms > Controls >
28 // Lists. Null puts the member straight in the attribute's menu
29 public string Submenu { get; set; } = null;
30 public GPALAttribute(string Description = "")
31 {
32 this.Description = Description;
33 }
34 }
35 [AttributeUsage(AttributeTargets.All, Inherited = true)]
36 class SingleUseAttribute : GPALAttribute
37 {
38 public SingleUseAttribute(string Description = "")
39 {
40 this.Description = Description;
41 }
42 }
43 #region GPAL Menu Names
44 [AttributeUsage(AttributeTargets.All, Inherited = true)]
45 class DataAttribute : GPALAttribute
46 {
47 public DataAttribute(string Description = "")
48 {
49 this.Description = Description;
50 }
51 }
52 [AttributeUsage(AttributeTargets.All, Inherited = true)]
53 class CallbackAttribute : GPALAttribute
54 {
55 public CallbackAttribute(string Description = "")
56 {
57 this.Description = Description;
58 }
59 }
60 [AttributeUsage(AttributeTargets.All, Inherited = true)]
61 class BrowserAttribute : GPALAttribute
62 {
63 public BrowserAttribute(string Description = "")
64 {
65 this.Description = Description;
66 }
67 }
68 [AttributeUsage(AttributeTargets.All, Inherited = true)]
69 class ActionAttribute : GPALAttribute
70 {
71 public ActionAttribute(string Description = "")
72 {
73 this.Description = Description;
74 }
75 }
76 [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, Inherited = true)]
77 class HelperAttribute : GPALAttribute
78 {
79 public HelperAttribute(string Description="")
80 {
81 this.Description = Description;
82 }
83 }
84 [AttributeUsage(AttributeTargets.All)]
85 class FluentAttribute : GPALAttribute
86 {
87 public FluentAttribute(string Description = "")
88 {
89 this.Description = Description;
90 }
91 }
92 [AttributeUsage(AttributeTargets.All)]
93 class SettingsAttribute : GPALAttribute
94 {
95 public SettingsAttribute(string Description = "")
96 {
97 this.Description = Description;
98 }
99 }
100 [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, Inherited = true)]
101 class GPALSettingsAttribute : GPALAttribute
102 {
103 public GPALSettingsAttribute(string Description = "")
104 {
105 this.Description = Description;
106 }
107 }
108 [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, Inherited = true)]
109 class ModifierAttribute : GPALAttribute
110 {
111 public ModifierAttribute(string Description = "")
112 {
113 this.Description = Description;
114 }
115 }
116 [AttributeUsage(AttributeTargets.Interface | AttributeTargets.Method, Inherited = true)]
117 class ConstantAttribute : GPALAttribute
118 {
119 public ConstantAttribute(string Description = "")
120 {
121 this.Description = Description;
122 }
123 }
124 [AttributeUsage(AttributeTargets.All)]
125 class FormsAttribute : GPALAttribute
126 {
127 public FormsAttribute(string Description = "")
128 {
129 this.Description = Description;
130 }
131 }
132 [AttributeUsage(AttributeTargets.All)]
133 class ComponentAttribute : GPALAttribute
134 {
135 public ComponentAttribute(string Description = "")
136 {
137 this.Description = Description;
138 }
139 }
140 [AttributeUsage(AttributeTargets.All)]
141 class ElementAssitantAttribute : GPALAttribute
142 {
143 public ElementAssitantAttribute(string Description = "")
144 {
145 this.Description = Description;
146 }
147 }
148 [AttributeUsage(AttributeTargets.All)]
149 class KeysAttribute : GPALAttribute
150 {
151 public KeysAttribute(string Description = "")
152 {
153 this.Description = Description;
154 }
155 }
156 [AttributeUsage(AttributeTargets.All)]
157 class FileAttribute : GPALAttribute
158 {
159 public FileAttribute(string Description = "")
160 {
161 this.Description = Description;
162 }
163 }
164 [AttributeUsage(AttributeTargets.All)]
165 class ScrollAttribute : GPALAttribute
166 {
167 public ScrollAttribute(string Description = "")
168 {
169 this.Description = Description;
170 }
171 }
172 [AttributeUsage(AttributeTargets.All)]
173 class WaitAttribute : GPALAttribute
174 {
175 public WaitAttribute(string Description = "")
176 {
177 this.Description = Description;
178 }
179 }
180 [AttributeUsage(AttributeTargets.All)]
181 class WorkflowAttribute : GPALAttribute
182 {
183 public WorkflowAttribute(string Description = "")
184 {
185 this.Description = Description;
186 }
187 }
188
189 #endregion GPAL Menu Names
190
191 #region Parameter Attributes
192 // Parameter attributes, to know how to deal with entering them via the studio
193 [AttributeUsage(AttributeTargets.All, Inherited = true)]
194 class EnumAttribute : GPALAttribute
195 {
196
197 public EnumAttribute(string Description = "In GPAL Studio, present menu of enum names")
198 {
199 this.Description = Description;
200 }
201 }
202 [AttributeUsage(AttributeTargets.All, Inherited = true)]
203 class DirectoryAttribute : GPALAttribute
204 {
205
206 public DirectoryAttribute(string Description = "")
207 {
208 this.Description = Description;
209 }
210 }
211 [AttributeUsage(AttributeTargets.All, Inherited = true)]
212 class IntAttribute : GPALAttribute
213 {
214
215 public IntAttribute(string Description = "")
216 {
217 this.Description = Description;
218 }
219 }
220 [AttributeUsage(AttributeTargets.All, Inherited = true)]
221 class URLAttribute : GPALAttribute
222 {
223
224 public URLAttribute(string Description = "")
225 {
226 this.Description = Description;
227 }
228 }
229 [AttributeUsage(AttributeTargets.All, Inherited = true)]
230 class GPALFileAttribute : GPALAttribute
231 {
232
233 public GPALFileAttribute(string Description = "")
234 {
235 this.Description = Description;
236 }
237 }
238 [AttributeUsage(AttributeTargets.All, Inherited = true)]
239 class SelectorAttribute : GPALAttribute
240 {
241
242 public SelectorAttribute(string Description = "")
243 {
244 this.Description = Description;
245 }
246 }
247 [AttributeUsage(AttributeTargets.All, Inherited = true)]
248 class BrowserTypeAttribute : GPALAttribute
249 {
250
251 public BrowserTypeAttribute(string Description = "")
252 {
253 this.Description = Description;
254 }
255 }
256 #endregion Parameter Attributes
257 #region Interface Attribute // the title of the dynamic dialog built to enter data for an interface (ie, IAllowSelectorSettings)
258 class InterfaceAttribute : GPALAttribute
259 {
260 public InterfaceAttribute(string Description = "")
261 {
262 this.Description = Description;
263 }
264 }
265 #endregion Interface Attribute
266 #region SelectorSet Attributes
267 // Parameter attributes, to know how to deal with entering them via the studio
268 [AttributeUsage(AttributeTargets.All, Inherited = true)]
269 public class WithCSS : GPALAttribute
270 {
271
272 public WithCSS(string Description = "Method name used to handle css value")
273 {
274 this.Description = Description;
275 this.MethodName = "WithCSS";
276 }
277 }
278
279 [AttributeUsage(AttributeTargets.All, Inherited = true)]
280 public class WithXPath : GPALAttribute
281 {
282
283 public WithXPath(string Description = "Method name used to handle x path")
284 {
285 this.Description = Description;
286 this.MethodName = "WithXPath";
287 }
288 }
289
290 [AttributeUsage(AttributeTargets.All, Inherited = true)]
291 public class WithValue : GPALAttribute
292 {
293
294 public WithValue(string Description = "")
295 {
296 this.Description = Description;
297 this.MethodName = "WithValue";
298 }
299 }
300
301 [AttributeUsage(AttributeTargets.All, Inherited = true)]
302 public class MatchValue : GPALAttribute
303 {
304
305 public MatchValue(string Description = "")
306 {
307 this.Description = Description;
308 this.MethodName = "MatchValue";
309 }
310 }
311
312 [AttributeUsage(AttributeTargets.All, Inherited = true)]
313 public class WithText : GPALAttribute
314 {
315
316 public WithText(string Description = "")
317 {
318 this.Description = Description;
319 this.MethodName = "WithText";
320 }
321 }
322
323 [AttributeUsage(AttributeTargets.All, Inherited = true)]
324 public class MatchText : GPALAttribute
325 {
326
327 public MatchText(string Description = "")
328 {
329 this.Description = Description;
330 this.MethodName = "MatchText";
331 }
332 }
333
334 [AttributeUsage(AttributeTargets.All, Inherited = true)]
335 public class MatchSrc : GPALAttribute
336 {
337
338 public MatchSrc(string Description = "")
339 {
340 this.Description = Description;
341 this.MethodName = "MatchSrc";
342 }
343 }
344
345 [AttributeUsage(AttributeTargets.All, Inherited = true)]
346 public class MatchHRef : GPALAttribute
347 {
348
349 public MatchHRef(string Description = "")
350 {
351 this.Description = Description;
352 this.MethodName = "MatchHRef";
353 }
354 }
355
356 [AttributeUsage(AttributeTargets.All, Inherited = true)]
357 public class MatchPlaceholder : GPALAttribute
358 {
359
360 public MatchPlaceholder(string Description = "")
361 {
362 this.Description = Description;
363 this.MethodName = "MatchPlaceholder";
364 }
365 }
366
367 [AttributeUsage(AttributeTargets.All, Inherited = true)]
368 public class WithSelectorName : GPALAttribute
369 {
370
371 public WithSelectorName(string Description = "")
372 {
373 this.Description = Description;
374 this.MethodName = "WithSelectorName";
375 }
376 }
377
378 [AttributeUsage(AttributeTargets.All, Inherited = true)]
379 public class WithOffsetX : GPALAttribute
380 {
381
382 public WithOffsetX(string Description = "")
383 {
384 this.Description = Description;
385 this.MethodName = "WithOffsetX";
386 }
387 }
388
389 [AttributeUsage(AttributeTargets.All, Inherited = true)]
390 public class WithOffsetY : GPALAttribute
391 {
392
393 public WithOffsetY(string Description = "")
394 {
395 this.Description = Description;
396 this.MethodName = "WithOffsetY";
397 }
398 }
399
400 [AttributeUsage(AttributeTargets.All, Inherited = true)]
401 public class WithDeltaX : GPALAttribute
402 {
403
404 public WithDeltaX(string Description = "")
405 {
406 this.Description = Description;
407 this.MethodName = "WithDeltaX";
408 }
409 }
410
411 [AttributeUsage(AttributeTargets.All, Inherited = true)]
412 public class WithDeltaY : GPALAttribute
413 {
414
415 public WithDeltaY(string Description = "")
416 {
417 this.Description = Description;
418 this.MethodName = "WithDeltaY";
419 }
420 }
421
422 [AttributeUsage(AttributeTargets.All, Inherited = true)]
423 public class WithImage : GPALAttribute
424 {
425
426 public WithImage(string Description = "")
427 {
428 this.Description = Description;
429 this.MethodName = "WithImage";
430 }
431 }
432
433 #endregion SelectorSet Attributes
434 #region Puppeteer Communicator Command Attributes
435 [AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
436 public sealed class CommandAttribute : Attribute
437 {
438 public string CommandString { get; }
439
440 public CommandAttribute(string commandString)
441 {
442 CommandString = commandString;
443 }
444 }
445 #endregion Puppeteer Communicator CommandAttributes
446 #region Experimental Attribute - designate features not completely developed
447 [AttributeUsage(AttributeTargets.All, Inherited = true)]
448 class InProgressAttribute : GPALAttribute
449 {
450 public InProgressAttribute(string Description = "")
451 {
452 this.Description = Description;
453 }
454 }
455 #endregion Experimental Attribute - designate features not completely developed
456}
457