コード例 #1
0
        public IVisio.Document Render(IVisio.Application app)
        {
            var docs = app.Documents;
            var doc = docs.Add("");

            var ctx = new FormRenderingContext(app);
            ctx.Application = app;
            ctx.Document = doc;
            ctx.Pages = doc.Pages;
            ctx.Fonts = doc.Fonts;

            this.VisioDocument = doc;

            doc.Subject = this.Subject;
            doc.Title = this.Title;
            doc.Creator = this.Creator;
            doc.Company = this.Company;

            var pages = doc.Pages;
            foreach (var formpage in this.Pages)
            {
                var page = formpage.Draw(ctx);
            }

            if (pages.Count > 0)
            {
                // Delete the empty first page
                var first_page = VisioDocument.Pages[1];
                first_page.Delete(1);
                first_page = pages[1];
                var active_window = app.ActiveWindow;
                active_window.Page = first_page;
            }
            return doc;
        }
コード例 #2
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);
        }
コード例 #3
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;
        }
コード例 #4
0
        public IVisio.Document Render(IVisio.Application app)
        {
            var docs = app.Documents;
            var doc  = docs.Add("");

            var ctx = new FormRenderingContext(app);

            ctx.Application = app;
            ctx.Document    = doc;
            ctx.Pages       = doc.Pages;
            ctx.Fonts       = doc.Fonts;

            this.VisioDocument = doc;

            doc.Subject = this.Subject;
            doc.Title   = this.Title;
            doc.Creator = this.Creator;
            doc.Company = this.Company;

            var pages = doc.Pages;

            foreach (var formpage in this.Pages)
            {
                var page = formpage.Draw(ctx);
            }

            if (pages.Count > 0)
            {
                // Delete the empty first page
                var first_page = VisioDocument.Pages[1];
                first_page.Delete(1);
                first_page = pages[1];
                var active_window = app.ActiveWindow;
                active_window.Page = first_page;
            }
            return(doc);
        }