public static List <TextFormat> GetFormat(IVisio.Page page, IList <int> shapeids) { var charcells = CharacterCells.GetCells(page, shapeids); var paracells = ParagraphCells.GetCells(page, shapeids); var textblockcells = TextBlockCells.GetCells(page, shapeids); var page_shapes = page.Shapes; var formats = new List <TextFormat>(shapeids.Count); for (int i = 0; i < shapeids.Count; i++) { var format = new TextFormat(); format.CharacterFormats = charcells[i]; format.ParagraphFormats = paracells[i]; format.TextBlock = textblockcells[i]; formats.Add(format); var shape = page_shapes.ItemFromID[shapeids[i]]; format.CharacterTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visCharPropRow, true); format.ParagraphTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visParaPropRow, true); format.TabStops = TextHelper.GetTabStops(shape); } return(formats); }
public CharacterCells GetCells(VA.ShapeSheet.CellData <double>[] row) { var cells = new CharacterCells(); cells.Color = row[this.Color.Ordinal].ToInt(); cells.Transparency = row[this.Trans.Ordinal]; cells.Font = row[this.Font.Ordinal].ToInt(); cells.Size = row[this.Size.Ordinal]; cells.Style = row[this.Style.Ordinal].ToInt(); cells.AsianFont = row[this.AsianFont.Ordinal].ToInt(); cells.AsianFont = row[this.AsianFont.Ordinal].ToInt(); cells.Case = row[this.Case.Ordinal].ToInt(); cells.ComplexScriptFont = row[this.ComplexScriptFont.Ordinal].ToInt(); cells.ComplexScriptSize = row[this.ComplexScriptSize.Ordinal]; cells.DoubleStrikeThrough = row[this.DoubleStrikethrough.Ordinal].ToBool(); cells.DoubleUnderline = row[this.DoubleUnderline.Ordinal].ToBool(); cells.FontScale = row[this.FontScale.Ordinal]; cells.LangID = row[this.LangID.Ordinal].ToInt(); cells.Letterspace = row[this.Letterspace.Ordinal]; cells.Locale = row[this.Locale.Ordinal].ToInt(); cells.LocalizeFont = row[this.LocalizeFont.Ordinal].ToInt(); cells.Overline = row[this.Overline.Ordinal].ToBool(); cells.Perpendicular = row[this.Perpendicular.Ordinal].ToBool(); cells.Pos = row[this.Pos.Ordinal].ToInt(); cells.RTLText = row[this.RTLText.Ordinal].ToInt(); cells.Strikethru = row[this.Strikethru.Ordinal].ToBool(); cells.UseVertical = row[this.UseVertical.Ordinal].ToInt(); return(cells); }
public static TextFormat GetFormat(IVisio.Shape shape) { var cells = new TextFormat(); cells.CharacterFormats = CharacterCells.GetCells(shape); cells.ParagraphFormats = ParagraphCells.GetCells(shape); cells.TextBlock = TextBlockCells.GetCells(shape); cells.CharacterTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visCharPropRow, true); cells.ParagraphTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visParaPropRow, true); cells.TabStops = TextFormat.GetTabStops(shape); return(cells); }
public void SetFont(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.CharacterCells(); cells.Font = font.ID; this._client.ShapeSheet.__SetCells(targets, cells, page); }
public CharacterCells GetCells(VA.ShapeSheet.CellData<double>[] row) { var cells = new CharacterCells(); cells.Color = row[this.Color.Ordinal].ToInt(); cells.Transparency = row[this.Trans.Ordinal]; cells.Font = row[this.Font.Ordinal].ToInt(); cells.Size = row[this.Size.Ordinal]; cells.Style = row[this.Style.Ordinal].ToInt(); cells.AsianFont = row[this.AsianFont.Ordinal].ToInt(); cells.AsianFont = row[this.AsianFont.Ordinal].ToInt(); cells.Case = row[this.Case.Ordinal].ToInt(); cells.ComplexScriptFont = row[this.ComplexScriptFont.Ordinal].ToInt(); cells.ComplexScriptSize = row[this.ComplexScriptSize.Ordinal]; cells.DoubleStrikeThrough = row[this.DoubleStrikethrough.Ordinal].ToBool(); cells.DoubleUnderline = row[this.DoubleUnderline.Ordinal].ToBool(); cells.FontScale = row[this.FontScale.Ordinal]; cells.LangID = row[this.LangID.Ordinal].ToInt(); cells.Letterspace = row[this.Letterspace.Ordinal]; cells.Locale = row[this.Locale.Ordinal].ToInt(); cells.LocalizeFont = row[this.LocalizeFont.Ordinal].ToInt(); cells.Overline = row[this.Overline.Ordinal].ToBool(); cells.Perpendicular = row[this.Perpendicular.Ordinal].ToBool(); cells.Pos = row[this.Pos.Ordinal].ToInt(); cells.RTLText = row[this.RTLText.Ordinal].ToInt(); cells.Strikethru = row[this.Strikethru.Ordinal].ToBool(); cells.UseVertical = row[this.UseVertical.Ordinal].ToInt(); return cells; }