public void SnapCorner(double w, double h, VA.Arrange.SnapCornerPosition corner) { if (!this.Client.HasSelectedShapes()) { return; } var shapes_2d = Client.Selection.EnumShapes2D().ToList(); var shapeids = shapes_2d.Select(s => s.ID).ToList(); var application = this.Client.VisioApplication; using (var undoscope = new VA.Application.UndoScope(application, "SnapCorner")) { var active_page = application.ActivePage; ArrangeHelper.SnapCorner(active_page, shapeids, new VA.Drawing.Size(w, h), corner); } }
public void SnapCorner(TargetShapes targets, double w, double h, SnapCornerPosition corner) { this._client.Application.AssertApplicationAvailable(); this._client.Document.AssertDocumentAvailable(); var shapes = targets.ResolveShapes2D(this._client); if (shapes.Shapes.Count < 1) { return; } var application = this._client.Application.Get(); var page = application.ActivePage; var target_ids = targets.ToShapeIDs(); using (var undoscope = this._client.Application.NewUndoScope("Snap Shape Corner")) { ArrangeHelper.SnapCorner(page, target_ids, new Drawing.Size(w, h), corner); } }
public void SnapCorner(IList <IVisio.Shape> target_shapes, double w, double h, SnapCornerPosition corner) { this.Client.Application.AssertApplicationAvailable(); this.Client.Document.AssertDocumentAvailable(); var shapes = this.GetTargetShapes2D(target_shapes); if (shapes.Count < 1) { return; } var shapeids = shapes.Select(s => s.ID).ToList(); var application = this.Client.Application.Get(); using (var undoscope = this.Client.Application.NewUndoScope("SnapCorner")) { var active_page = application.ActivePage; ArrangeHelper.SnapCorner(active_page, shapeids, new Drawing.Size(w, h), corner); } }