/// <summary> /// Raises a mouse event with <see cref="WebElementCapturedMouseEventArgs"/>. /// </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 raiseMouseEvent(Dictionary <string, object> evn, Action <WebElementCapturedMouseEventArgs> eventMethod) { WebElementCapturedMouseEventArgs mouseArgs = new WebElementCapturedMouseEventArgs(WrappedDriver, (IWebElement)evn["target"]); mapCommonEventArgs(mouseArgs, evn); mouseArgs.Button = (long?)evn["button"]; mouseArgs.ClientX = (long?)evn["clientX"]; mouseArgs.ClientY = (long?)evn["clientY"]; mouseArgs.OffsetX = (long?)evn["offsetX"]; mouseArgs.OffsetY = (long?)evn["offsetY"]; raiseEvent(() => eventMethod(mouseArgs)); }
/// <summary> /// Raises the <see cref="ElementClickCaptured"/> event. /// </summary> /// <param name="e">A <see cref="WebElementCapturedMouseEventArgs"/> that contains the event data.</param> protected virtual void OnElementClickCaptured(WebElementCapturedMouseEventArgs e) { ElementClickCaptured?.Invoke(this, e); }