public void MarkupCharacterPlain()
        {
            var m = new VisioAutomation.Text.Markup.TextElement("{Normal}");
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;
            Assert.AreEqual(1, charfmt.Count);

            page1.Delete(0);
        }
Пример #2
0
        public static void ProgressBar()
        {
            var page_a = SampleEnvironment.Application.ActiveDocument.Pages.Add();


            // Draw some shapes
            var background = page_a.DrawRectangle(0, 0, 5, 1);
            var progress   = page_a.DrawRectangle(0, 0, 1, 1);

            var background_fmt = new VA.Shapes.FormatCells();

            background_fmt.FillForegnd = "rgb(240,240,240)";
            background_fmt.LineColor   = "rgb(100,100,100)";


            var progress_fmt = new VA.Shapes.FormatCells();

            progress_fmt.FillForegnd = "rgb(100,150,240)";
            progress_fmt.LineColor   = "rgb(100,100,100)";

            // group the two shapes together
            page_a.Application.ActiveWindow.SelectAll();
            var group = page_a.Application.ActiveWindow.Selection.Group();

            // Set the progress shape update itself based on its position
            string bkname = background.NameID;
            var    xform  = new VA.Shapes.XFormCells();

            xform.PinX   = string.Format("GUARD({0}!PinX-{0}!LocPinX+LocPinX)", bkname);
            xform.PinY   = string.Format("GUARD({0}!PinY)", bkname);
            xform.Width  = string.Format("GUARD({0}!Width*(PAGENUMBER()/PAGECOUNT()))", bkname);
            xform.Height = string.Format("GUARD({0}!Height)", bkname);

            var update = new VA.ShapeSheet.Update();

            update.SetFormulas(progress.ID16, xform);
            update.SetFormulas(progress.ID16, background_fmt);
            update.SetFormulas(progress.ID16, progress_fmt);
            update.Execute(page_a);

            var markup1 = new VA.Text.Markup.TextElement();

            markup1.AddField(VA.Text.Markup.FieldConstants.PageName);
            markup1.AddText(" (");
            markup1.AddField(VA.Text.Markup.FieldConstants.PageNumber);
            markup1.AddText(" of ");
            markup1.AddField(VA.Text.Markup.FieldConstants.NumberOfPages);
            markup1.AddText(") ");
            markup1.SetText(group);
        }
        public static void TextMarkup14()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);
            var e1 = new VA.Text.Markup.TextElement();
            e1.AddText("This shape is ");
            e1.AddField(VA.Text.Markup.FieldConstants.Width);
            e1.AddText("inches wide by ");
            e1.AddField(VA.Text.Markup.FieldConstants.Height);
            e1.AddText("inches tall.");
            e1.SetText(s1);
        }
        public static void TextFields()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();
            var s0 = page.DrawRectangle(1, 1, 4, 4);

            var markup1 = new VA.Text.Markup.TextElement();
            markup1.AddField(VA.Text.Markup.FieldConstants.PageName);
            markup1.AddText(" (");
            markup1.AddField(VA.Text.Markup.FieldConstants.PageNumber);
            markup1.AddText(" of ");
            markup1.AddField(VA.Text.Markup.FieldConstants.NumberOfPages);
            markup1.AddText(") ");
            markup1.SetText(s0);
        }
        public static void TextMarkup14()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);
            var e1 = new VA.Text.Markup.TextElement();

            e1.AddText("This shape is ");
            e1.AddField(VA.Text.Markup.FieldConstants.Width);
            e1.AddText("inches wide by ");
            e1.AddField(VA.Text.Markup.FieldConstants.Height);
            e1.AddText("inches tall.");
            e1.SetText(s1);
        }
        public void MarkupCharacterItalic()
        {
            var m = new VisioAutomation.Text.Markup.TextElement("{Italic}");
            m.CharacterCells.Style = (int)VisioAutomation.Text.CharStyle.Italic;
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;
            Assert.AreEqual(1, charfmt.Count);
            Assert.AreEqual((int)VisioAutomation.Text.CharStyle.Italic, charfmt[0].Style.Result);

            page1.Delete(0);
        }
Пример #7
0
        public void MarkupParagraphDefault()
        {
            var m     = new VisioAutomation.Text.Markup.TextElement("{DefaultPara}");
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0    = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;

            Assert.AreEqual(1, parafmt.Count);

            page1.Delete(0);
        }
Пример #8
0
        public void MarkupCharacterPlain()
        {
            var m     = new VisioAutomation.Text.Markup.TextElement("{Normal}");
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0    = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;

            Assert.AreEqual(1, charfmt.Count);

            page1.Delete(0);
        }
Пример #9
0
        public static void TextFields()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();
            var s0   = page.DrawRectangle(1, 1, 4, 4);

            var markup1 = new VA.Text.Markup.TextElement();

            markup1.AddField(VA.Text.Markup.FieldConstants.PageName);
            markup1.AddText(" (");
            markup1.AddField(VA.Text.Markup.FieldConstants.PageNumber);
            markup1.AddText(" of ");
            markup1.AddField(VA.Text.Markup.FieldConstants.NumberOfPages);
            markup1.AddText(") ");
            markup1.SetText(s0);
        }
        public static void TextMarkup11()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);
            var tnr = page.Document.Fonts["Times New Roman"];

            var e1 = new VA.Text.Markup.TextElement();
            var color_red = new VA.Drawing.ColorRGB(0xff0000);
            e1.CharacterCells.Color = color_red.ToFormula();
            e1.CharacterCells.Font = tnr.ID;
            e1.CharacterCells.Font = "20pt";
            e1.AddText("Hello World");
            e1.SetText(s1);
        }
        public static void TextMarkup13()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();
            var segoe_ui = page.Document.Fonts["Segoe UI"];

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);
            var e1 = new VA.Text.Markup.TextElement();
            e1.AddText("When, from behind that craggy steep\n");
            e1.AddText("till then the horizon’s bound\n");
            var e2 = e1.AddElementEx("a huge peak, black and huge\n", null, null, null, VA.Drawing.AlignmentHorizontal.Left, VA.Text.CharStyle.Italic);
            var e3 = e1.AddElementEx("As if with voluntary power instinct\n", segoe_ui.ID, null, null, VA.Drawing.AlignmentHorizontal.Center, VA.Text.CharStyle.Bold);
            var e4 = e1.AddElementEx("Upreared its head.\n", null, null, null, VA.Drawing.AlignmentHorizontal.Right, VA.Text.CharStyle.Italic);
            e1.AddText("-William Wordsworth, the Prelude");
            e1.SetText(s1);
        }
        public static void TextMarkup11()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1  = page.DrawRectangle(0, 0, 8.5, 11);
            var tnr = page.Document.Fonts["Times New Roman"];

            var e1        = new VA.Text.Markup.TextElement();
            var color_red = new VA.Drawing.ColorRGB(0xff0000);

            e1.CharacterCells.Color = color_red.ToFormula();
            e1.CharacterCells.Font  = tnr.ID;
            e1.CharacterCells.Font  = "20pt";
            e1.AddText("Hello World");
            e1.SetText(s1);
        }
        public static void ProgressBar()
        {
            var page_a = SampleEnvironment.Application.ActiveDocument.Pages.Add();


            // Draw some shapes
            var background = page_a.DrawRectangle(0, 0, 5, 1);
            var progress = page_a.DrawRectangle(0, 0, 1, 1);

            var background_fmt = new VA.Shapes.FormatCells();
            background_fmt.FillForegnd= "rgb(240,240,240)";
            background_fmt.LineColor = "rgb(100,100,100)";


            var progress_fmt = new VA.Shapes.FormatCells();
            progress_fmt.FillForegnd = "rgb(100,150,240)";
            progress_fmt.LineColor = "rgb(100,100,100)";

            // group the two shapes together
            page_a.Application.ActiveWindow.SelectAll();
            var group = page_a.Application.ActiveWindow.Selection.Group();

            // Set the progress shape update itself based on its position
            string bkname = background.NameID;
            var xform = new VA.Shapes.XFormCells();
            xform.PinX = string.Format("GUARD({0}!PinX-{0}!LocPinX+LocPinX)", bkname);
            xform.PinY = string.Format("GUARD({0}!PinY)", bkname);
            xform.Width = string.Format("GUARD({0}!Width*(PAGENUMBER()/PAGECOUNT()))", bkname);
            xform.Height = string.Format("GUARD({0}!Height)", bkname); 

            var update = new VA.ShapeSheet.Update();
            update.SetFormulas(progress.ID16, xform);
            update.SetFormulas(progress.ID16, background_fmt);
            update.SetFormulas(progress.ID16, progress_fmt);
            update.Execute(page_a);

            var markup1 = new VA.Text.Markup.TextElement();
            markup1.AddField(VA.Text.Markup.FieldConstants.PageName);
            markup1.AddText(" (");
            markup1.AddField(VA.Text.Markup.FieldConstants.PageNumber);
            markup1.AddText(" of ");
            markup1.AddField(VA.Text.Markup.FieldConstants.NumberOfPages);
            markup1.AddText(") ");
            markup1.SetText(group);
        }
Пример #14
0
        public void MarkupCharacterItalic()
        {
            var m = new VisioAutomation.Text.Markup.TextElement("{Italic}");

            m.CharacterCells.Style = (int)VisioAutomation.Text.CharStyle.Italic;
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0    = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;

            Assert.AreEqual(1, charfmt.Count);
            Assert.AreEqual((int)VisioAutomation.Text.CharStyle.Italic, charfmt[0].Style.Result);

            page1.Delete(0);
        }
        public void MarkupCharacterFont()
        {
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));

            var impact = page1.Document.Fonts["Arial"];
            var m = new VisioAutomation.Text.Markup.TextElement("Normal Text in Impact Font");
            m.CharacterCells.Font = impact.ID;
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;
            Assert.AreEqual(1, charfmt.Count);
            Assert.AreEqual(0, charfmt[0].Style.Result);
            Assert.AreEqual(impact.ID, charfmt[0].Font.Result);

            page1.Delete(0);
        }
        public static void TextMarkup13()
        {
            var page     = SampleEnvironment.Application.ActiveDocument.Pages.Add();
            var segoe_ui = page.Document.Fonts["Segoe UI"];

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);
            var e1 = new VA.Text.Markup.TextElement();

            e1.AddText("When, from behind that craggy steep\n");
            e1.AddText("till then the horizon’s bound\n");
            var e2 = e1.AddElementEx("a huge peak, black and huge\n", null, null, null, VA.Drawing.AlignmentHorizontal.Left, VA.Text.CharStyle.Italic);
            var e3 = e1.AddElementEx("As if with voluntary power instinct\n", segoe_ui.ID, null, null, VA.Drawing.AlignmentHorizontal.Center, VA.Text.CharStyle.Bold);
            var e4 = e1.AddElementEx("Upreared its head.\n", null, null, null, VA.Drawing.AlignmentHorizontal.Right, VA.Text.CharStyle.Italic);

            e1.AddText("-William Wordsworth, the Prelude");
            e1.SetText(s1);
        }
Пример #17
0
        public void MarkupParagraphRight()
        {
            var m = new VisioAutomation.Text.Markup.TextElement("{RightHAlign}");

            m.ParagraphCells.HorizontalAlign = (int)VisioAutomation.Models.BoxLayout.AlignmentHorizontal.Right;
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0    = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;

            Assert.AreEqual(1, parafmt.Count);

            Assert.AreEqual((int)VisioAutomation.Models.BoxLayout.AlignmentHorizontal.Right, parafmt[0].HorizontalAlign.Result);

            page1.Delete(0);
        }
Пример #18
0
        public void MarkupParagraphCenter()
        {
            var m = new VA.Text.Markup.TextElement("{CenterHAlign}");

            m.ParagraphCells.HorizontalAlign = (int)VA.Drawing.AlignmentHorizontal.Center;
            var page1 = this.GetNewPage(new VA.Drawing.Size(5, 5));
            var s0    = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VA.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;

            Assert.AreEqual(1, parafmt.Count);

            Assert.AreEqual((int)VA.Drawing.AlignmentHorizontal.Center, parafmt[0].HorizontalAlign.Result);

            page1.Delete(0);
        }
Пример #19
0
        public void MarkupCharacterFont()
        {
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));

            var impact = page1.Document.Fonts["Arial"];
            var m      = new VisioAutomation.Text.Markup.TextElement("Normal Text in Impact Font");

            m.CharacterCells.Font = impact.ID;
            var s0 = page1.DrawRectangle(0, 0, 4, 4);

            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;

            Assert.AreEqual(1, charfmt.Count);
            Assert.AreEqual(0, charfmt[0].Style.Result);
            Assert.AreEqual(impact.ID, charfmt[0].Font.Result);

            page1.Delete(0);
        }
        public static void TextMarkup5()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);

            var e1 = new VA.Text.Markup.TextElement();

            e1.ParagraphCells.HorizontalAlign = 0;
            var e2 = e1.AddElement("Hello Worldline1\nline2\nline3\n");

            e2.ParagraphCells.IndentFirst = "0.5pt";
            e2.ParagraphCells.IndentLeft  = "0.25pt";
            var e3 = e1.AddElement("Goodbye\nline1\nline2\nline3");

            e3.ParagraphCells.IndentFirst = "1.0pt";
            e3.ParagraphCells.IndentLeft  = "0.75pt";

            e1.SetText(s1);
        }
Пример #21
0
        public void MarkupCharacterComplex()
        {
            var page1 = this.GetNewPage(new VA.Drawing.Size(5, 5));
            var doc = page1.Document;
            var fonts = doc.Fonts;

            var segoeui = fonts["Segoe UI"];
            var impact = fonts["Arial"];
            var couriernew = fonts["Courier New"];
            var georgia = fonts["Georgia"];

            var t1 = new VA.Text.Markup.TextElement("{Normal}");
            t1.CharacterCells.Font = segoeui.ID;

            var t2 = t1.AddElement("{Italic}");
            t2.CharacterCells.Style = (int)VA.Text.CharStyle.Italic;
            t2.CharacterCells.Font = impact.ID;

            var t3 = t2.AddElement("{Bold}");
            t3.CharacterCells.Style = (int)VA.Text.CharStyle.Bold;
            t3.CharacterCells.Font = couriernew.ID;

            var t4 = t2.AddElement("{Bold Italic}");
            t4.CharacterCells.Style = (int)(VA.Text.CharStyle.Bold | VA.Text.CharStyle.Italic);
            t4.CharacterCells.Font = georgia.ID;

            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            t1.SetText(s0);

            var textfmt = VA.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;

            // check the number of character regions
            Assert.AreEqual(5, charfmt.Count);

            // check the fonts
            Assert.AreEqual(segoeui.ID, charfmt[0].Font.Result);
            Assert.AreEqual(impact.ID, charfmt[1].Font.Result);
            Assert.AreEqual(couriernew.ID, charfmt[2].Font.Result);
            Assert.AreEqual(georgia.ID, charfmt[3].Font.Result);
            Assert.AreEqual(segoeui.ID, charfmt[4].Font.Result);

            // check the styles
            Assert.AreEqual((int)VA.Text.CharStyle.None, charfmt[0].Style.Result);
            Assert.AreEqual((int)VA.Text.CharStyle.Italic, charfmt[1].Style.Result);
            Assert.AreEqual((int)VA.Text.CharStyle.Bold, charfmt[2].Style.Result);
            Assert.AreEqual((int)(VA.Text.CharStyle.Italic | VA.Text.CharStyle.Bold), charfmt[3].Style.Result);
            Assert.AreEqual((int)(VA.Text.CharStyle.None), charfmt[4].Style.Result);

            // check the text run content
            var charruns = textfmt.CharacterTextRuns;
            Assert.AreEqual(4, charruns.Count);
            Assert.AreEqual("{Normal}", charruns[0].Text);
            Assert.AreEqual("{Italic}", charruns[1].Text);
            Assert.AreEqual("{Bold}", charruns[2].Text);
            Assert.AreEqual("{Bold Italic}", charruns[3].Text);

            // cleanup
            page1.Delete(0);
        }
Пример #22
0
        public void MarkupCharacterComplex()
        {
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var doc   = page1.Document;
            var fonts = doc.Fonts;

            var segoeui    = fonts["Segoe UI"];
            var impact     = fonts["Arial"];
            var couriernew = fonts["Courier New"];
            var georgia    = fonts["Georgia"];

            var t1 = new VisioAutomation.Text.Markup.TextElement("{Normal}");

            t1.CharacterCells.Font = segoeui.ID;

            var t2 = t1.AddElement("{Italic}");

            t2.CharacterCells.Style = (int)VisioAutomation.Text.CharStyle.Italic;
            t2.CharacterCells.Font  = impact.ID;

            var t3 = t2.AddElement("{Bold}");

            t3.CharacterCells.Style = (int)VisioAutomation.Text.CharStyle.Bold;
            t3.CharacterCells.Font  = couriernew.ID;

            var t4 = t2.AddElement("{Bold Italic}");

            t4.CharacterCells.Style = (int)(VisioAutomation.Text.CharStyle.Bold | VisioAutomation.Text.CharStyle.Italic);
            t4.CharacterCells.Font  = georgia.ID;

            var s0 = page1.DrawRectangle(0, 0, 4, 4);

            t1.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var charfmt = textfmt.CharacterFormats;

            // check the number of character regions
            Assert.AreEqual(5, charfmt.Count);

            // check the fonts
            Assert.AreEqual(segoeui.ID, charfmt[0].Font.Result);
            Assert.AreEqual(impact.ID, charfmt[1].Font.Result);
            Assert.AreEqual(couriernew.ID, charfmt[2].Font.Result);
            Assert.AreEqual(georgia.ID, charfmt[3].Font.Result);
            Assert.AreEqual(segoeui.ID, charfmt[4].Font.Result);


            // check the styles
            Assert.AreEqual((int)VisioAutomation.Text.CharStyle.None, charfmt[0].Style.Result);
            Assert.AreEqual((int)VisioAutomation.Text.CharStyle.Italic, charfmt[1].Style.Result);
            Assert.AreEqual((int)VisioAutomation.Text.CharStyle.Bold, charfmt[2].Style.Result);
            Assert.AreEqual((int)(VisioAutomation.Text.CharStyle.Italic | VisioAutomation.Text.CharStyle.Bold), charfmt[3].Style.Result);
            Assert.AreEqual((int)(VisioAutomation.Text.CharStyle.None), charfmt[4].Style.Result);

            // check the text run content
            var charruns = textfmt.CharacterTextRuns;

            Assert.AreEqual(4, charruns.Count);
            Assert.AreEqual("{Normal}", charruns[0].Text);
            Assert.AreEqual("{Italic}", charruns[1].Text);
            Assert.AreEqual("{Bold}", charruns[2].Text);
            Assert.AreEqual("{Bold Italic}", charruns[3].Text);

            // cleanup
            page1.Delete(0);
        }
        public static void TextMarkup5()
        {
            var page = SampleEnvironment.Application.ActiveDocument.Pages.Add();

            // Create the Shapes that will hold the text
            var s1 = page.DrawRectangle(0, 0, 8.5, 11);

            var e1 = new VA.Text.Markup.TextElement();
            e1.ParagraphCells.HorizontalAlign = 0;
            var e2 = e1.AddElement("Hello Worldline1\nline2\nline3\n");
            e2.ParagraphCells.IndentFirst = "0.5pt";
            e2.ParagraphCells.IndentLeft= "0.25pt";
            var e3 = e1.AddElement("Goodbye\nline1\nline2\nline3");
            e3.ParagraphCells.IndentFirst = "1.0pt";
            e3.ParagraphCells.IndentLeft= "0.75pt";

            e1.SetText(s1);
        }
Пример #24
0
        public void MarkupParagraphRight()
        {
            var m = new VA.Text.Markup.TextElement("{RightHAlign}");
            m.ParagraphCells.HorizontalAlign = (int)VA.Drawing.AlignmentHorizontal.Right;
            var page1 = this.GetNewPage(new VA.Drawing.Size(5, 5));
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VA.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;
            Assert.AreEqual(1, parafmt.Count);

            Assert.AreEqual((int)VA.Drawing.AlignmentHorizontal.Right, parafmt[0].HorizontalAlign.Result);

            page1.Delete(0);
        }
Пример #25
0
        public void MarkupParagraphDefault()
        {
            var m = new VA.Text.Markup.TextElement("{DefaultPara}");
            var page1 = this.GetNewPage(new VA.Drawing.Size(5, 5));
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VA.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;
            Assert.AreEqual(1, parafmt.Count);

            page1.Delete(0);
        }
        public void MarkupParagraphCenter()
        {
            var m = new VisioAutomation.Text.Markup.TextElement("{CenterHAlign}");
            m.ParagraphCells.HorizontalAlign = (int)VisioAutomation.Models.BoxLayout.AlignmentHorizontal.Center;
            var page1 = this.GetNewPage(new VisioAutomation.Drawing.Size(5, 5));
            var s0 = page1.DrawRectangle(0, 0, 4, 4);
            m.SetText(s0);

            var textfmt = VisioAutomation.Text.TextFormat.GetFormat(s0);
            var parafmt = textfmt.ParagraphFormats;
            Assert.AreEqual(1, parafmt.Count);

            Assert.AreEqual((int)VisioAutomation.Models.BoxLayout.AlignmentHorizontal.Center, parafmt[0].HorizontalAlign.Result);

            page1.Delete(0);
        }