コード例 #1
0
            public PointerMoveInteraction(InputDevice sourceDevice, IWebElement target, CoordinateOrigin origin, int x, int y, TimeSpan duration, PointerEventProperties properties)
                : base(sourceDevice)
            {
                if (target != null)
                {
                    this.target = target;
                    this.origin = CoordinateOrigin.Element;
                }
                else
                {
                    if (this.origin != CoordinateOrigin.Element)
                    {
                        this.origin = origin;
                    }
                }

                if (duration != TimeSpan.MinValue)
                {
                    this.duration = duration;
                }

                this.x = x;
                this.y = y;
                this.eventProperties = properties;
            }
コード例 #2
0
 public PointerUpInteraction(InputDevice sourceDevice, MouseButton button, PointerEventProperties properties)
     : base(sourceDevice)
 {
     this.button = button;
 }
コード例 #3
0
 /// <summary>
 /// Creates a pointer move action to a specific element.
 /// </summary>
 /// <param name="target">The <see cref="IWebElement"/> used as the target for the move.</param>
 /// <param name="xOffset">The horizontal offset from the origin of the move.</param>
 /// <param name="yOffset">The vertical offset from the origin of the move.</param>
 /// <param name="duration">The length of time the move gesture takes to complete.</param>
 /// <param name="properties">The specifications for the pointer event interaction</param>
 /// <returns>The action representing the pointer move gesture.</returns>
 public Interaction CreatePointerMove(IWebElement target, int xOffset, int yOffset, TimeSpan duration, PointerEventProperties properties)
 {
     return(new PointerMoveInteraction(this, target, CoordinateOrigin.Element, xOffset, yOffset, duration, properties));
 }
コード例 #4
0
        /// <summary>
        /// Creates a pointer move action to an absolute coordinate.
        /// </summary>
        /// <param name="origin">The origin of coordinates for the move. Values can be relative to
        /// the view port origin, or the most recent pointer position.</param>
        /// <param name="xOffset">The horizontal offset from the origin of the move.</param>
        /// <param name="yOffset">The vertical offset from the origin of the move.</param>
        /// <param name="duration">The length of time the move gesture takes to complete.</param>
        /// <returns>The action representing the pointer move gesture.</returns>
        /// <exception cref="ArgumentException">Thrown when passing CoordinateOrigin.Element into origin.
        /// Users should us the other CreatePointerMove overload to move to a specific element.</exception>
        public Interaction CreatePointerMove(CoordinateOrigin origin, int xOffset, int yOffset, TimeSpan duration, PointerEventProperties properties)
        {
            if (origin == CoordinateOrigin.Element)
            {
                throw new ArgumentException("Using a value of CoordinateOrigin.Element without an element is not supported.", nameof(origin));
            }

            return(new PointerMoveInteraction(this, null, origin, xOffset, yOffset, duration, properties));
        }
コード例 #5
0
 /// <summary>
 /// Creates a pointer down action.
 /// </summary>
 /// <remarks>
 /// MouseButton value applies to Pen types for primary, secondary and erase functionality (0, 2, and 5 respectively)
 /// </remarks>
 /// <param name="button">The button of the pointer that should be pressed.</param>
 /// <param name="properties">The specifications for the pointer event interaction</param>
 /// <returns>The action representing the pointer down gesture.</returns>
 public Interaction CreatePointerUp(MouseButton button, PointerEventProperties properties)
 {
     return(new PointerUpInteraction(this, button, properties));
 }