Beispiel #1
0
        public static List <TextFormat> GetFormat(IVisio.Page page, IList <int> shapeids, CellValueType type)
        {
            var charcells      = CharacterFormatCells.GetCells(page, shapeids, type);
            var paracells      = ParagraphFormatCells.GetCells(page, shapeids, type);
            var textblockcells = TextBlockCells.GetCells(page, shapeids, type);
            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);
        }
Beispiel #2
0
        public static TextFormat GetFormat(IVisio.Shape shape, CellValueType type)
        {
            var cells = new TextFormat();

            cells.CharacterFormats = CharacterFormatCells.GetCells(shape, type);
            cells.ParagraphFormats = ParagraphFormatCells.GetCells(shape, type);
            cells.TextBlock        = TextBlockCells.GetCells(shape, type);
            if (HasTextXFormCells(shape))
            {
                cells.TextXForm = TextXFormCells.GetCells(shape, type);
            }
            cells.CharacterTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visCharPropRow, true);
            cells.ParagraphTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visParaPropRow, true);
            cells.TabStops          = TextHelper.GetTabStops(shape);
            return(cells);
        }