예제 #1
0
        public VisioAutomation.Geometry.Rectangle GetBoundingBox(IVisio.VisBoundingBoxArgs args)
        {
            double bbx0, bby0, bbx1, bby1;

            if (this.Master != null)
            {
                this.Master.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else if (this.Page != null)
            {
                this.Page.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else if (this.Shape != null)
            {
                this.Shape.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            }
            else
            {
                throw new System.ArgumentException("Unhandled Drawing Surface");
            }

            var r = new VisioAutomation.Geometry.Rectangle(bbx0, bby0, bbx1, bby1);

            return(r);
        }
예제 #2
0
        private static void SetViewRectToSelection(IVisio.Window window,
                                                   IVisio.VisBoundingBoxArgs bbargs,
                                                   double padding_scale)
        {
            if (padding_scale < 0.0)
            {
                throw new System.ArgumentOutOfRangeException(nameof(padding_scale));
            }

            if (padding_scale > 1.0)
            {
                throw new System.ArgumentOutOfRangeException(nameof(padding_scale));
            }

            var app           = window.Application;
            var active_window = app.ActiveWindow;
            var sel           = active_window.Selection;
            var sel_bb        = sel.GetBoundingBox(bbargs);

            var delta     = sel_bb.Size * padding_scale;
            var view_rect = new Drawing.Rectangle(sel_bb.Left - delta.Width, sel_bb.Bottom - delta.Height,
                                                  sel_bb.Right + delta.Height, sel_bb.Top + delta.Height);

            window.SetViewRect(view_rect);
        }
예제 #3
0
        public static Drawing.Rectangle GetBoundingBox(this IVisio.Shape shape, IVisio.VisBoundingBoxArgs args)
        {
            var surface = new Drawing.DrawingSurface(shape);
            var r       = surface.GetBoundingBox(args);

            return(r);
        }
예제 #4
0
        public static Geometry.Rectangle GetBoundingBox(
            this IVisio.Shape shape,
            IVisio.VisBoundingBoxArgs args)
        {
            var surface = new SurfaceTarget(shape);
            var r       = surface.GetBoundingBox(args);

            return(r);
        }
예제 #5
0
        public static Drawing.Rectangle GetBoundingBox(IVisio.Selection selection, IVisio.VisBoundingBoxArgs args)
        {
            double bbx0, bby0, bbx1, bby1;

            selection.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            var r = new Drawing.Rectangle(bbx0, bby0, bbx1, bby1);

            return(r);
        }
예제 #6
0
        public static Drawing.Rectangle GetBoundingBox(this IVisio.Master master, IVisio.VisBoundingBoxArgs args)
        {
            // MSDN: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vissdk11/html/vimthBoundingBox_HV81900422.asp
            double bbx0, bby0, bbx1, bby1;

            master.BoundingBox((short)args, out bbx0, out bby0, out bbx1, out bby1);
            var r = new Drawing.Rectangle(bbx0, bby0, bbx1, bby1);

            return(r);
        }
예제 #7
0
 public static Drawing.Rectangle GetBoundingBox(this IVisio.Master master, IVisio.VisBoundingBoxArgs args)
 {
     return(VisioAutomation.Masters.MasterHelper.GetBoundingBox(master, args));
 }
예제 #8
0
        public static Geometry.Rectangle GetBoundingBox(this IVisio.Master master, IVisio.VisBoundingBoxArgs args)
        {
            var surface = new VisioAutomation.SurfaceTarget(master);

            return(surface.GetBoundingBox(args));
        }
예제 #9
0
 public static Drawing.Rectangle GetBoundingBox(this IVisio.Selection selection, IVisio.VisBoundingBoxArgs args)
 {
     return(VisioAutomation.Selections.SelectionHelper.GetBoundingBox(selection, args));
 }
예제 #10
0
 public static Drawing.Rectangle GetBoundingBox(this IVisio.Shape shape, IVisio.VisBoundingBoxArgs args)
 {
     return(Shapes.ShapeHelper.GetBoundingBox(shape, args));
 }
예제 #11
0
        public static Drawing.Rectangle GetBoundingBox(this IVisio.Master master, IVisio.VisBoundingBoxArgs args)
        {
            var surface = new VisioAutomation.Drawing.DrawingSurface(master);

            return(surface.GetBoundingBox(args));
        }