|
19 | 19 |
|
20 | 20 | using System;
|
21 | 21 |
|
22 |
| -namespace OpenQA.Selenium.Support.Events |
| 22 | +namespace OpenQA.Selenium.Support.Events; |
| 23 | + |
| 24 | +/// <summary> |
| 25 | +/// Provides data for events related to finding elements. |
| 26 | +/// </summary> |
| 27 | +public class FindElementEventArgs : EventArgs |
23 | 28 | {
|
24 | 29 | /// <summary>
|
25 |
| - /// Provides data for events related to finding elements. |
| 30 | + /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class. |
26 | 31 | /// </summary>
|
27 |
| - public class FindElementEventArgs : EventArgs |
| 32 | + /// <param name="driver">The WebDriver instance used in finding elements.</param> |
| 33 | + /// <param name="method">The <see cref="By"/> object containing the method used to find elements.</param> |
| 34 | + /// <exception cref="ArgumentNullException">If <paramref name="driver"/> or <paramref name="method"/> are <see langword="null"/>.</exception> |
| 35 | + public FindElementEventArgs(IWebDriver driver, By method) |
| 36 | + : this(driver, null, method) |
28 | 37 | {
|
29 |
| - /// <summary> |
30 |
| - /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class. |
31 |
| - /// </summary> |
32 |
| - /// <param name="driver">The WebDriver instance used in finding elements.</param> |
33 |
| - /// <param name="method">The <see cref="By"/> object containing the method used to find elements.</param> |
34 |
| - /// <exception cref="ArgumentNullException">If <paramref name="driver"/> or <paramref name="method"/> are <see langword="null"/>.</exception> |
35 |
| - public FindElementEventArgs(IWebDriver driver, By method) |
36 |
| - : this(driver, null, method) |
37 |
| - { |
38 |
| - } |
| 38 | + } |
39 | 39 |
|
40 |
| - /// <summary> |
41 |
| - /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class. |
42 |
| - /// </summary> |
43 |
| - /// <param name="driver">The WebDriver instance used in finding elements.</param> |
44 |
| - /// <param name="element">The parent element used as the context for the search, or <see langword="null"/> if none exists.</param> |
45 |
| - /// <param name="method">The <see cref="By"/> object containing the method used to find elements.</param> |
46 |
| - /// <exception cref="ArgumentNullException">If <paramref name="driver"/> or <paramref name="method"/> are <see langword="null"/>.</exception> |
47 |
| - public FindElementEventArgs(IWebDriver driver, IWebElement? element, By method) |
48 |
| - { |
49 |
| - this.Driver = driver ?? throw new ArgumentNullException(nameof(driver)); |
50 |
| - this.Element = element; |
51 |
| - this.FindMethod = method ?? throw new ArgumentNullException(nameof(method)); |
52 |
| - } |
| 40 | + /// <summary> |
| 41 | + /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class. |
| 42 | + /// </summary> |
| 43 | + /// <param name="driver">The WebDriver instance used in finding elements.</param> |
| 44 | + /// <param name="element">The parent element used as the context for the search, or <see langword="null"/> if none exists.</param> |
| 45 | + /// <param name="method">The <see cref="By"/> object containing the method used to find elements.</param> |
| 46 | + /// <exception cref="ArgumentNullException">If <paramref name="driver"/> or <paramref name="method"/> are <see langword="null"/>.</exception> |
| 47 | + public FindElementEventArgs(IWebDriver driver, IWebElement? element, By method) |
| 48 | + { |
| 49 | + this.Driver = driver ?? throw new ArgumentNullException(nameof(driver)); |
| 50 | + this.Element = element; |
| 51 | + this.FindMethod = method ?? throw new ArgumentNullException(nameof(method)); |
| 52 | + } |
53 | 53 |
|
54 |
| - /// <summary> |
55 |
| - /// Gets the WebDriver instance used in finding elements. |
56 |
| - /// </summary> |
57 |
| - public IWebDriver Driver { get; } |
| 54 | + /// <summary> |
| 55 | + /// Gets the WebDriver instance used in finding elements. |
| 56 | + /// </summary> |
| 57 | + public IWebDriver Driver { get; } |
58 | 58 |
|
59 |
| - /// <summary> |
60 |
| - /// Gets the parent element used as the context for the search, or <see langword="null"/> if no element is associated. |
61 |
| - /// </summary> |
62 |
| - public IWebElement? Element { get; } |
| 59 | + /// <summary> |
| 60 | + /// Gets the parent element used as the context for the search, or <see langword="null"/> if no element is associated. |
| 61 | + /// </summary> |
| 62 | + public IWebElement? Element { get; } |
63 | 63 |
|
64 |
| - /// <summary> |
65 |
| - /// Gets the <see cref="By"/> object containing the method used to find elements. |
66 |
| - /// </summary> |
67 |
| - public By FindMethod { get; } |
68 |
| - } |
| 64 | + /// <summary> |
| 65 | + /// Gets the <see cref="By"/> object containing the method used to find elements. |
| 66 | + /// </summary> |
| 67 | + public By FindMethod { get; } |
69 | 68 | }
|
0 commit comments