Beispiel #1
0
        void AddCoordsAndDimensionsToNode(UIObject uiObjectToAdd, XmlNode nodeToPopulate)
        {
            var attribute1 = this._xmlDoc.CreateAttribute(name: "x");
            var attribute2 = this._xmlDoc.CreateAttribute(name: "y");
            var attribute3 = this._xmlDoc.CreateAttribute(name: "width");
            var attribute4 = this._xmlDoc.CreateAttribute(name: "height");

            try {
                var boundingRectangle = uiObjectToAdd.GetAdjustedBoundingRectangle();
                attribute3.Value = boundingRectangle.Width.ToString();
                var xmlAttribute1 = attribute4;
                var num           = boundingRectangle.Height;
                var str1          = num.ToString();
                xmlAttribute1.Value = str1;
                var relativePoint = PositionAdapter.GetRelativePoint(absolutePoint: boundingRectangle.TopLeft, referencePoint: this._applicationRootRectangle.TopLeft);
                var xmlAttribute2 = attribute1;
                num = relativePoint.X;
                var str2 = num.ToString();
                xmlAttribute2.Value = str2;
                var xmlAttribute3 = attribute2;
                num = relativePoint.Y;
                var str3 = num.ToString();
                xmlAttribute3.Value = str3;
            } catch {
                attribute1.Value = "0";
                attribute2.Value = "0";
                attribute3.Value = "0";
                attribute4.Value = "0";
            }

            nodeToPopulate.Attributes.Append(node: attribute1);
            nodeToPopulate.Attributes.Append(node: attribute2);
            nodeToPopulate.Attributes.Append(node: attribute3);
            nodeToPopulate.Attributes.Append(node: attribute4);
        }
Beispiel #2
0
        public static SizeI GetAdjustedBoundingRectangleOffsetSize(this UIObject obj)
        {
            RectangleI boundingRectangle1 = obj.GetAdjustedBoundingRectangle();
            RectangleI boundingRectangle2 = obj.BoundingRectangle;

            return(new SizeI(boundingRectangle2.Width - boundingRectangle1.Width, boundingRectangle2.Height - boundingRectangle1.Height));
        }
Beispiel #3
0
        public static PointI GetAdjustedBoundingRectangleOffsetPosition(this UIObject obj)
        {
            RectangleI boundingRectangle1 = obj.GetAdjustedBoundingRectangle();
            RectangleI boundingRectangle2 = obj.BoundingRectangle;

            return(new PointI(boundingRectangle2.Left - boundingRectangle1.Left, boundingRectangle2.Top - boundingRectangle1.Top));
        }
        internal static ResponseStatus SendMouseMoveToElementRelative(
            string mouseMoveType,
            UIObject element,
            int xOffset,
            int yOffset)
        {
            var topLeft = element.GetAdjustedBoundingRectangle().TopLeft;

            topLeft.X += xOffset;
            topLeft.Y += yOffset;
            using (InputController.Activate(inputType: PointerInputType.Mouse)) {
                PointerInput.Move(point: topLeft);
                return(ResponseStatus.Success);
            }
        }
Beispiel #5
0
        public static PointI GetAdjustedBoundingRectangleCenterPosition(this UIObject obj)
        {
            RectangleI boundingRectangle = obj.GetAdjustedBoundingRectangle();

            return(new PointI(boundingRectangle.Left + boundingRectangle.Width / 2, boundingRectangle.Top + boundingRectangle.Height / 2));
        }