"Fossies" - the Fresh Open Source Software Archive

Member "selenium-selenium-4.8.1/dotnet/src/support/Events/FindElementEventArgs.cs" (17 Feb 2023, 2969 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "FindElementEventArgs.cs" see the Fossies "Dox" file reference documentation.

    1 // <copyright file="FindElementEventArgs.cs" company="WebDriver Committers">
    2 // Licensed to the Software Freedom Conservancy (SFC) under one
    3 // or more contributor license agreements. See the NOTICE file
    4 // distributed with this work for additional information
    5 // regarding copyright ownership. The SFC licenses this file
    6 // to you under the Apache License, Version 2.0 (the "License");
    7 // you may not use this file except in compliance with the License.
    8 // You may obtain a copy of the License at
    9 //
   10 //     http://www.apache.org/licenses/LICENSE-2.0
   11 //
   12 // Unless required by applicable law or agreed to in writing, software
   13 // distributed under the License is distributed on an "AS IS" BASIS,
   14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   15 // See the License for the specific language governing permissions and
   16 // limitations under the License.
   17 // </copyright>
   18 
   19 using System;
   20 
   21 namespace OpenQA.Selenium.Support.Events
   22 {
   23     /// <summary>
   24     /// Provides data for events related to finding elements.
   25     /// </summary>
   26     public class FindElementEventArgs : EventArgs
   27     {
   28         private IWebDriver driver;
   29         private IWebElement element;
   30         private By method;
   31 
   32         /// <summary>
   33         /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class.
   34         /// </summary>
   35         /// <param name="driver">The WebDriver instance used in finding elements.</param>
   36         /// <param name="method">The <see cref="By"/> object containing the method used to find elements</param>
   37         public FindElementEventArgs(IWebDriver driver, By method)
   38             : this(driver, null, method)
   39         {
   40         }
   41 
   42         /// <summary>
   43         /// Initializes a new instance of the <see cref="FindElementEventArgs"/> class.
   44         /// </summary>
   45         /// <param name="driver">The WebDriver instance used in finding elements.</param>
   46         /// <param name="element">The parent element used as the context for the search.</param>
   47         /// <param name="method">The <see cref="By"/> object containing the method used to find elements.</param>
   48         public FindElementEventArgs(IWebDriver driver, IWebElement element, By method)
   49         {
   50             this.driver = driver;
   51             this.element = element;
   52             this.method = method;
   53         }
   54 
   55         /// <summary>
   56         /// Gets the WebDriver instance used in finding elements.
   57         /// </summary>
   58         public IWebDriver Driver
   59         {
   60             get { return this.driver; }
   61         }
   62 
   63         /// <summary>
   64         /// Gets the parent element used as the context for the search.
   65         /// </summary>
   66         public IWebElement Element
   67         {
   68             get { return this.element; }
   69         }
   70 
   71         /// <summary>
   72         /// Gets the <see cref="By"/> object containing the method used to find elements.
   73         /// </summary>
   74         public By FindMethod
   75         {
   76             get { return this.method; }
   77         }
   78     }
   79 }