Example #1
0
        public void Distribute(VA.Drawing.Axis axis, double d)
        {
            if (!this.Client.HasActiveDocument)
            {
                return;
            }
            var application = this.Client.VisioApplication;
            var selection   = this.Client.Selection.Get();
            var shapeids    = selection.GetIDs();

            using (var undoscope = new UndoScope(application, "Distribute"))
            {
                ArrangeHelper.DistributeWithSpacing(application.ActivePage, shapeids, axis, d);
            }
        }
        public void DistributeOnAxis(TargetShapes targets, Axis axis, double spacing)
        {
            if (!this._client.Document.HasActiveDocument)
            {
                return;
            }
            var page = this._client.Page.Get();

            targets = targets.ResolveShapes(this._client);
            var targetids = targets.ToShapeIDs();

            using (var undoscope = this._client.Application.NewUndoScope("Distribute on Axis"))
            {
                ArrangeHelper.DistributeWithSpacing(page, targetids, axis, spacing);
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        public void SnapSize(TargetShapes targets, Drawing.Size snapsize, Drawing.Size minsize)
        {
            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 Size"))
            {
                ArrangeHelper.SnapSize(page, target_ids, snapsize, minsize);
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
        public void SnapSize(IList <IVisio.Shape> target_shapes, Drawing.Size snapsize, Drawing.Size minsize)
        {
            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("SnapSize"))
            {
                var active_page = application.ActivePage;
                ArrangeHelper.SnapSize(active_page, shapeids, snapsize, minsize);
            }
        }
Example #7
0
        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);
            }
        }
Example #8
0
        public FileResult DownSumExcel()
        {
            RouteSumAppUser2 model = new RouteSumAppUser2();

            model.adcd     = adcd;
            model.adcdName = "浙江省";
            List <SelectSumAppUserList> list = logic.GetSelectSumAppUserList2(model);

            list = list.OrderBy(x => x.adcdId).ToList();
            list = ArrangeHelper.GetList(list);
            List <string> title = new List <string>();

            title.Add("单位名称");
            title.Add("责任人总人数");
            title.Add("已注册人数");
            HSSFWorkbook book    = ExcelHelper.CreateExecl(title, list);
            string       strdate = "APP注册人员统计" + DateTime.Now.ToString("yyyyMMddhhmmss");//获取当前

            // 写入到客户端
            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            book.Write(ms);
            ms.Seek(0, SeekOrigin.Begin);
            return(File(ms, "application/vnd.ms-excel", strdate + ".xls"));
        }