Esempio n. 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();
 }
Esempio n. 2
0
 public TextBlock(Drawing.Size size, string text)
 {
     this.Text           = text;
     this.Size           = size;
     this.TextBlockCells = new VisioAutomation.Text.TextBlockCells();
     this.ParagraphCells = new VisioAutomation.Text.ParagraphCells();
     this.FormatCells    = new Shapes.ShapeFormatCells();
     this.CharacterCells = new VisioAutomation.Text.CharacterCells();
 }
        public void Set(TargetShapes targets, Shapes.ShapeFormatCells format)
        {
            this._client.Application.AssertApplicationAvailable();
            this._client.Document.AssertDocumentAvailable();

            targets = targets.ResolveShapes(this._client);

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

            var writer   = new FormulaWriterSIDSRC();
            var shapeids = targets.Shapes.Select(s => s.ID).ToList();

            foreach (int shapeid in shapeids)
            {
                format.SetFormulas((short)shapeid, writer);
            }

            var application = this._client.Application.Get();

            writer.Commit(application.ActivePage);
        }