Ejemplo n.º 1
0
        private static double GetPositionOnShape(XForm xform, VisioAutomation.Scripting.Layout.RelativePosition pos)
        {
            var r = xform.GetRectangle();

            switch (pos)
            {
            case VisioAutomation.Scripting.Layout.RelativePosition.PinY:
                return(xform.PinY);

            case VisioAutomation.Scripting.Layout.RelativePosition.PinX:
                return(xform.PinX);

            case VisioAutomation.Scripting.Layout.RelativePosition.Left:
                return(r.Left);

            case VisioAutomation.Scripting.Layout.RelativePosition.Right:
                return(r.Right);

            case VisioAutomation.Scripting.Layout.RelativePosition.Top:
                return(r.Top);

            case VisioAutomation.Scripting.Layout.RelativePosition.Bottom:
                return(r.Bottom);
            }

            throw new System.ArgumentOutOfRangeException(nameof(pos));
        }