Exemplo n.º 1
0
        public IVisio.Page CreatePage(FormPage formpage)
        {
            this._form_page = formpage;

            this._page      = this._visio_pages.Add();
            this._page.Name = formpage.Name;

            // Update the Page Cells
            var pagesheet = this._page.PageSheet;
            var writer    = new SrcWriter();

            var pagecells = new Pages.PageCells();

            pagecells.PageWidth         = formpage.Size.Width;
            pagecells.PageHeight        = formpage.Size.Height;
            pagecells.PrintLeftMargin   = formpage.Margin.Left;
            pagecells.PrintRightMargin  = formpage.Margin.Right;
            pagecells.PrintTopMargin    = formpage.Margin.Top;
            pagecells.PrintBottomMargin = formpage.Margin.Bottom;
            pagecells.SetFormulas(writer);

            writer.Commit(pagesheet);

            this.Reset();
            return(this._page);
        }
Exemplo n.º 2
0
        public IVisio.Page CreatePage(FormPage formpage)
        {
            this.FormPage = formpage;

            this.page      = this.VisioPages.Add();
            this.page.Name = formpage.Name;

            // Update the Page Cells
            var pagesheet  = this.page.PageSheet;
            var pageupdate = new ShapeSheet.Update();

            var pagecells = new Pages.PageCells();

            pagecells.PageWidth        = formpage.Size.Width;
            pagecells.PageHeight       = formpage.Size.Height;
            pagecells.PageLeftMargin   = formpage.Margin.Left;
            pagecells.PageRightMargin  = formpage.Margin.Right;
            pagecells.PageTopMargin    = formpage.Margin.Top;
            pagecells.PageBottomMargin = formpage.Margin.Bottom;
            pageupdate.SetFormulas(pagecells);
            pageupdate.Execute(pagesheet);


            this.Reset();
            return(this.page);
        }
        public IVisio.Page CreatePage(FormPage formpage)
        {
            this.FormPage = formpage;

            this.page = this.VisioPages.Add();
            this.page.Name = formpage.Name;

            // Update the Page Cells
            var pagesheet = this.page.PageSheet;
            var pageupdate = new ShapeSheet.Update();

            var pagecells = new Pages.PageCells();
            pagecells.PageWidth = formpage.Size.Width;
            pagecells.PageHeight = formpage.Size.Height;
            pagecells.PageLeftMargin = formpage.Margin.Left;
            pagecells.PageRightMargin = formpage.Margin.Right;
            pagecells.PageTopMargin = formpage.Margin.Top;
            pagecells.PageBottomMargin = formpage.Margin.Bottom;
            pageupdate.SetFormulas(pagecells);
            pageupdate.Execute(pagesheet);


            this.Reset();
            return this.page;
        }
Exemplo n.º 4
0
        public Page()
        {
            this.Shapes    = new ShapeList();
            this.PageCells = new Pages.PageCells();

            this.PerfSettings             = new Application.PerfSettings();
            this.PerfSettings.DeferRecalc = 0;

            // By Enable ScreenUpdating by default
            // If it is disabled it messes up page resizing (there may be a workaround)
            // TODO: Try the DrawTreeMultiNode2 unit test to see how setting it to 1 will affect the rendering

            this.PerfSettings.ScreenUpdating    = 1;
            this.PerfSettings.EnableAutoConnect = false;
            this.PerfSettings.LiveDynamics      = false;
        }
Exemplo n.º 5
0
        public Page()
        {
            this.Shapes = new ShapeList();
            this.PageCells = new Pages.PageCells();

            this.PerfSettings = new Application.PerfSettings();
            this.PerfSettings.DeferRecalc = 0;

            // By Enable ScreenUpdating by default
            // If it is disabled it messes up page resizing (there may be a workaround)
            // TODO: Try the DrawTreeMultiNode2 unit test to see how setting it to 1 will affect the rendering

            this.PerfSettings.ScreenUpdating = 1;
            this.PerfSettings.EnableAutoConnect = false;
            this.PerfSettings.LiveDynamics = false;
        }
Exemplo n.º 6
0
        internal IVisio.Page Draw(FormRenderingContext ctx)
        {
            var r          = new InteractiveRenderer(ctx.Document);
            var page_cells = new Pages.PageCells();

            this.VisioPage = r.CreatePage(this);
            ctx.Page       = this.VisioPage;

            var titleblock = new TextBlock(new Drawing.Size(7.5, 0.5), this.Title);

            int _fontid = ctx.GetFontID(this.DefaultFont);

            titleblock.TextBlockCells.VerticalAlign   = 0;
            titleblock.ParagraphCells.HorizontalAlign = 0;
            titleblock.FormatCells.LineWeight         = 0;
            titleblock.FormatCells.LinePattern        = 0;
            titleblock.CharacterCells.Font            = _fontid;
            titleblock.CharacterCells.Size            = get_pt_string(this.TitleTextSize);



            // Draw the shapes
            var titleshape = r.AddShape(titleblock);

            r.Linefeed();

            double body_height = r.GetDistanceToBottomMargin();
            var    bodyblock   = new TextBlock(new Drawing.Size(7.5, body_height), this.Body);

            bodyblock.ParagraphCells.HorizontalAlign = 0;
            bodyblock.ParagraphCells.SpacingAfter    = get_pt_string(this.BodyParaSpacingAfter);
            bodyblock.CharacterCells.Font            = _fontid;
            bodyblock.CharacterCells.Size            = get_pt_string(this.BodyTextSize);
            bodyblock.FormatCells.LineWeight         = 0;
            bodyblock.FormatCells.LinePattern        = 0;
            bodyblock.TextBlockCells.VerticalAlign   = 0;
            bodyblock.FormatCells.LineWeight         = 0;
            bodyblock.FormatCells.LinePattern        = 0;

            var bodyshape = r.AddShape(bodyblock);

            r.Linefeed();

            r.Finish();
            return(this.VisioPage);
        }
        internal IVisio.Page Draw(FormRenderingContext ctx)
        {
            var r = new InteractiveRenderer(ctx.Document);
            var page_cells = new Pages.PageCells();
            this.VisioPage = r.CreatePage(this);
            ctx.Page = this.VisioPage;

            var titleblock = new TextBlock(new Drawing.Size(7.5, 0.5), this.Title);

            int _fontid = ctx.GetFontID(this.DefaultFont);
            titleblock.TextBlockCells.VerticalAlign = 0;
            titleblock.ParagraphCells.HorizontalAlign = 0;
            titleblock.FormatCells.LineWeight = 0;
            titleblock.FormatCells.LinePattern = 0;
            titleblock.CharacterCells.Font = _fontid;
            titleblock.CharacterCells.Size = get_pt_string(this.TitleTextSize);



            // Draw the shapes
            var titleshape = r.AddShape(titleblock);
            r.Linefeed();

            double body_height = r.GetDistanceToBottomMargin();
            var bodyblock = new TextBlock(new Drawing.Size(7.5, body_height), this.Body);
            bodyblock.ParagraphCells.HorizontalAlign = 0;
            bodyblock.ParagraphCells.SpacingAfter = get_pt_string(this.BodyParaSpacingAfter);
            bodyblock.CharacterCells.Font = _fontid;
            bodyblock.CharacterCells.Size = get_pt_string(this.BodyTextSize);
            bodyblock.FormatCells.LineWeight = 0;
            bodyblock.FormatCells.LinePattern = 0;
            bodyblock.TextBlockCells.VerticalAlign = 0;
            bodyblock.FormatCells.LineWeight = 0;
            bodyblock.FormatCells.LinePattern = 0;

            var bodyshape = r.AddShape(bodyblock);
            r.Linefeed();

            r.Finish();
            return this.VisioPage;
        }
Exemplo n.º 8
0
        public override Pages.PageCells CellDataToCellGroup(ShapeSheet.CellData[] row)
        {
            var cells = new Pages.PageCells();

            cells.PageLeftMargin       = row[this.PageLeftMargin];
            cells.CenterX              = row[this.CenterX];
            cells.CenterY              = row[this.CenterY];
            cells.OnPage               = row[this.OnPage];
            cells.PageBottomMargin     = row[this.PageBottomMargin];
            cells.PageRightMargin      = row[this.PageRightMargin];
            cells.PagesX               = row[this.PagesX];
            cells.PagesY               = row[this.PagesY];
            cells.PageTopMargin        = row[this.PageTopMargin];
            cells.PaperKind            = row[this.PaperKind];
            cells.PrintGrid            = row[this.PrintGrid];
            cells.PrintPageOrientation = row[this.PrintPageOrientation];
            cells.ScaleX               = row[this.ScaleX];
            cells.ScaleY               = row[this.ScaleY];
            cells.PaperSource          = row[this.PaperSource];
            cells.DrawingScale         = row[this.DrawingScale];
            cells.DrawingScaleType     = row[this.DrawingScaleType];
            cells.DrawingSizeType      = row[this.DrawingSizeType];
            cells.InhibitSnap          = row[this.InhibitSnap];
            cells.PageHeight           = row[this.PageHeight];
            cells.PageScale            = row[this.PageScale];
            cells.PageWidth            = row[this.PageWidth];
            cells.ShdwObliqueAngle     = row[this.ShdwObliqueAngle];
            cells.ShdwOffsetX          = row[this.ShdwOffsetX];
            cells.ShdwOffsetY          = row[this.ShdwOffsetY];
            cells.ShdwScaleFactor      = row[this.ShdwScaleFactor];
            cells.ShdwType             = row[this.ShdwType];
            cells.UIVisibility         = row[this.UIVisibility];
            cells.XGridDensity         = row[this.XGridDensity];
            cells.XGridOrigin          = row[this.XGridOrigin];
            cells.XGridSpacing         = row[this.XGridSpacing];
            cells.XRulerDensity        = row[this.XRulerDensity];
            cells.XRulerOrigin         = row[this.XRulerOrigin];
            cells.YGridDensity         = row[this.YGridDensity];
            cells.YGridOrigin          = row[this.YGridOrigin];
            cells.YGridSpacing         = row[this.YGridSpacing];
            cells.YRulerDensity        = row[this.YRulerDensity];
            cells.YRulerOrigin         = row[this.YRulerOrigin];
            cells.AvenueSizeX          = row[this.AvenueSizeX];
            cells.AvenueSizeY          = row[this.AvenueSizeY];
            cells.BlockSizeX           = row[this.BlockSizeX];
            cells.BlockSizeY           = row[this.BlockSizeY];
            cells.CtrlAsInput          = row[this.CtrlAsInput];
            cells.DynamicsOff          = row[this.DynamicsOff];
            cells.EnableGrid           = row[this.EnableGrid];
            cells.LineAdjustFrom       = row[this.LineAdjustFrom];
            cells.LineAdjustTo         = row[this.LineAdjustTo];
            cells.LineJumpCode         = row[this.LineJumpCode];
            cells.LineJumpFactorX      = row[this.LineJumpFactorX];
            cells.LineJumpFactorY      = row[this.LineJumpFactorY];
            cells.LineJumpStyle        = row[this.LineJumpStyle];
            cells.LineRouteExt         = row[this.LineRouteExt];
            cells.LineToLineX          = row[this.LineToLineX];
            cells.LineToLineY          = row[this.LineToLineY];
            cells.LineToNodeX          = row[this.LineToNodeX];
            cells.LineToNodeY          = row[this.LineToNodeY];
            cells.PageLineJumpDirX     = row[this.PageLineJumpDirX];
            cells.PageLineJumpDirY     = row[this.PageLineJumpDirY];
            cells.PageShapeSplit       = row[this.PageShapeSplit];
            cells.PlaceDepth           = row[this.PlaceDepth];
            cells.PlaceFlip            = row[this.PlaceFlip];
            cells.PlaceStyle           = row[this.PlaceStyle];
            cells.PlowCode             = row[this.PlowCode];
            cells.ResizePage           = row[this.ResizePage];
            cells.RouteStyle           = row[this.RouteStyle];
            cells.AvoidPageBreaks      = row[this.AvoidPageBreaks];
            cells.DrawingResizeType    = row[this.DrawingResizeType];
            return(cells);
        }
Exemplo n.º 9
0
        public override Pages.PageCells CellDataToCellGroup(VisioAutomation.Utilities.ArraySegment <ShapeSheet.CellData> row)
        {
            var cells = new Pages.PageCells();

            cells.PrintLeftMargin           = row[this.PrintLeftMargin];
            cells.PrintCenterX              = row[this.PrintCenterX];
            cells.PrintCenterY              = row[this.PrintCenterY];
            cells.PrintOnPage               = row[this.PrintOnPage];
            cells.PrintBottomMargin         = row[this.PrintBottomMargin];
            cells.PrintRightMargin          = row[this.PrintRightMargin];
            cells.PrintPagesX               = row[this.PrintPagesX];
            cells.PrintPagesY               = row[this.PrintPagesY];
            cells.PrintTopMargin            = row[this.PrintTopMargin];
            cells.PrintPaperKind            = row[this.PrintPaperKind];
            cells.PrintGrid                 = row[this.PrintGrid];
            cells.PrintPageOrientation      = row[this.PrintPageOrientation];
            cells.PrintScaleX               = row[this.PrintScaleX];
            cells.PrintScaleY               = row[this.PrintScaleY];
            cells.PrintPaperSource          = row[this.PrintPaperSource];
            cells.PageDrawingScale          = row[this.PageDrawingScale];
            cells.PageDrawingScaleType      = row[this.PageDrawingScaleType];
            cells.PageDrawingSizeType       = row[this.PageDrawingSizeType];
            cells.PageInhibitSnap           = row[this.PageInhibitSnap];
            cells.PageHeight                = row[this.PageHeight];
            cells.PageScale                 = row[this.PageScale];
            cells.PageWidth                 = row[this.PageWidth];
            cells.PageShadowObliqueAngle    = row[this.PageShadowObliqueAngle];
            cells.PageShadowOffsetX         = row[this.PageShadowOffsetX];
            cells.PageShadowOffsetY         = row[this.PageShadowOffsetY];
            cells.PageShadowScaleFactor     = row[this.PageShadowScaleFactor];
            cells.PageShadowType            = row[this.PageShadowType];
            cells.PageUIVisibility          = row[this.PageUIVisibility];
            cells.XGridDensity              = row[this.XGridDensity];
            cells.XGridOrigin               = row[this.XGridOrigin];
            cells.XGridSpacing              = row[this.XGridSpacing];
            cells.XRulerDensity             = row[this.XRulerDensity];
            cells.XRulerOrigin              = row[this.XRulerOrigin];
            cells.YGridDensity              = row[this.YGridDensity];
            cells.YGridOrigin               = row[this.YGridOrigin];
            cells.YGridSpacing              = row[this.YGridSpacing];
            cells.YRulerDensity             = row[this.YRulerDensity];
            cells.YRulerOrigin              = row[this.YRulerOrigin];
            cells.PageLayoutAvenueSizeX     = row[this.PageLayoutAvenueSizeX];
            cells.PageLayoutAvenueSizeY     = row[this.PageLayoutAvenueSizeY];
            cells.PageLayoutBlockSizeX      = row[this.PageLayoutBlockSizeX];
            cells.PageLayoutBlockSizeY      = row[this.PageLayoutBlockSizeY];
            cells.PageLayoutCtrlAsInput     = row[this.PageLayoutControlAsInput];
            cells.PageLayoutDynamicsOff     = row[this.PageLayoutDynamicsOff];
            cells.PageLayoutEnableGrid      = row[this.PageLayoutEnableGrid];
            cells.PageLayoutLineAdjustFrom  = row[this.PageLayoutLineAdjustFrom];
            cells.PageLayoutLineAdjustTo    = row[this.PageLayoutLineAdjustTo];
            cells.PageLayoutLineJumpCode    = row[this.PageLayoutLineJumpCode];
            cells.PageLayoutLineJumpFactorX = row[this.PageLayoutLineJumpFactorX];
            cells.PageLayoutLineJumpFactorY = row[this.PageLayoutLineJumpFactorY];
            cells.PageLayoutLineJumpStyle   = row[this.PageLayoutLineJumpStyle];
            cells.PageLayoutLineRouteExt    = row[this.PageLayoutLineRouteExt];
            cells.PageLayoutLineToLineX     = row[this.PageLayoutLineToLineX];
            cells.PageLayoutLineToLineY     = row[this.PageLayoutLineToLineY];
            cells.PageLayoutLineToNodeX     = row[this.PageLayoutLineToNodeX];
            cells.PageLayoutLineToNodeY     = row[this.PageLayoutLineToNodeY];
            cells.PageLayoutLineJumpDirX    = row[this.PageLayoutLineJumpDirX];
            cells.PageLayoutLineJumpDirY    = row[this.PageLayoutLineJumpDirY];
            cells.PageLayoutPageShapeSplit  = row[this.PageLayoutShapeSplit];
            cells.PageLayoutPlaceDepth      = row[this.PageLayoutPlaceDepth];
            cells.PageLayoutPlaceFlip       = row[this.PageLayoutPlaceFlip];
            cells.PageLayoutPlaceStyle      = row[this.PageLayoutPlaceStyle];
            cells.PageLayoutPlowCode        = row[this.PageLayoutPlowCode];
            cells.PageLayoutResizePage      = row[this.PageLayoutResizePage];
            cells.PageLayoutRouteStyle      = row[this.PageLayoutRouteStyle];
            cells.PageLayoutAvoidPageBreaks = row[this.PageLayoutAvoidPageBreaks];
            cells.PageDrawingResizeType     = row[this.PageDrawingResizeType];
            return(cells);
        }