Ejemplo n.º 1
0
        /// <summary>
        /// Raises a keyboard event with <see cref="WebElementCapturedKeyboardEventArgs"/>.
        /// </summary>
        /// <param name="evn">The DOM event data pulled off the event queue</param>
        /// <param name="eventMethod">A delegate pointing to the event-raising method for the specific event to be raised.</param>
        private void raiseKeyboardEvent(Dictionary <string, object> evn, Action <WebElementCapturedKeyboardEventArgs> eventMethod)
        {
            WebElementCapturedKeyboardEventArgs keyboardArgs = new WebElementCapturedKeyboardEventArgs(WrappedDriver, (IWebElement)evn["target"]);

            mapCommonEventArgs(keyboardArgs, evn);

            keyboardArgs.Code = (string)evn["code"];
            keyboardArgs.Key  = (string)evn["key"];

            raiseEvent(() => eventMethod(keyboardArgs));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Raises the <see cref="ElementKeyPressCaptured"/> event.
 /// </summary>
 /// <param name="e">A <see cref="WebElementCapturedKeyboardEventArgs"/> that contains the event data.</param>
 protected virtual void OnElementKeyPressCaptured(WebElementCapturedKeyboardEventArgs e)
 {
     ElementKeyPressCaptured?.Invoke(this, e);
 }