Пример #1
0
        public void Send(TargetShapes targets, VisioAutomation.Scripting.Layout.ShapeSendDirection dir)
        {
            this._client.Application.AssertApplicationAvailable();
            this._client.Document.AssertDocumentAvailable();

            int shape_count = targets.SetSelectionGetSelectedCount(this._client);

            if (shape_count < 1)
            {
                return;
            }

            var selection = this._client.Selection.Get();

            ArrangeCommands.SendShapes(selection, dir);
        }
Пример #2
0
        public void Distribute(IList <IVisio.Shape> target_shapes, Drawing.AlignmentHorizontal halign)
        {
            this.Client.Application.AssertApplicationAvailable();
            this.Client.Document.AssertDocumentAvailable();

            int shape_count = this.GetTargetSelection(target_shapes);

            if (shape_count < 1)
            {
                return;
            }

            var cmd = ArrangeCommands._map_halign_to_uicmd(halign);

            var application = this.Client.Application.Get();

            application.DoCmd((short)cmd);
        }
Пример #3
0
        public void Distribute(IList <IVisio.Shape> target_shapes, Drawing.Axis axis)
        {
            this.Client.Application.AssertApplicationAvailable();
            this.Client.Document.AssertDocumentAvailable();

            int shape_count = this.GetTargetSelection(target_shapes);

            if (shape_count < 1)
            {
                return;
            }

            var cmd = ArrangeCommands._map_axis_to_uicmd(axis);

            var application = this.Client.Application.Get();

            using (var undoscope = this.Client.Application.NewUndoScope("Distribute Shapes"))
            {
                application.DoCmd((short)cmd);
            }
        }
Пример #4
0
        public void Align(IList <IVisio.Shape> target_shapes, Drawing.AlignmentHorizontal align)
        {
            this.Client.Application.AssertApplicationAvailable();
            this.Client.Document.AssertDocumentAvailable();

            int shape_count = this.GetTargetSelection(target_shapes);

            if (shape_count < 2)
            {
                return;
            }

            var application = this.Client.Application.Get();

            using (var undoscope = this.Client.Application.NewUndoScope("Align Shapes"))
            {
                const bool glue_to_guide = false;
                var        selection     = this.Client.Selection.Get();
                var        halign        = ArrangeCommands._map_isd_halign_to_visio_halign(align);
                var        valign        = IVisio.VisVerticalAlignTypes.visVertAlignNone;
                selection.Align(halign, valign, glue_to_guide);
            }
        }