Example #1
0
 public Formatting()
 {
     this.ShapeFormatCells     = new Shapes.ShapeFormatCells();
     this.CharacterFormatCells = new VisioAutomation.Text.CharacterFormatCells();
     this.ParagraphFormatCells = new VisioAutomation.Text.ParagraphFormatCells();
     this.TextBlockCells       = new VisioAutomation.Text.TextBlockCells();
 }
Example #2
0
 public TextBlock(Geometry.Size size, string text)
 {
     this.Text                 = text;
     this.Size                 = size;
     this.TextBlockCells       = new VisioAutomation.Text.TextBlockCells();
     this.ParagraphFormatCells = new VisioAutomation.Text.ParagraphFormatCells();
     this.FormatCells          = new Shapes.ShapeFormatCells();
     this.CharacterFormatCells = new VisioAutomation.Text.CharacterFormatCells();
 }
Example #3
0
        public void SetFont(VisioScripting.Models.TargetShapes targets, string fontname)
        {
            this._client.Application.AssertApplicationAvailable();
            this._client.Document.AssertDocumentAvailable();

            targets = targets.ResolveShapes(this._client);

            if (targets.Shapes.Count < 1)
            {
                return;
            }

            var application      = this._client.Application.Get();
            var active_document  = application.ActiveDocument;
            var active_doc_fonts = active_document.Fonts;
            var font             = active_doc_fonts[fontname];
            var page             = this._client.Page.Get();

            var cells = new VisioAutomation.Text.CharacterFormatCells();

            cells.Font = font.ID;

            this._client.ShapeSheet.__SetCells(targets, cells, page);
        }