Пример #1
0
        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 = TabStopHelper.GetTabStops(shape);
            }

            return(formats);
        }
Пример #2
0
        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);
            if (HasTextXFormCells(shape))
            {
                cells.TextXForm = TextXFormCells.GetCells(shape);
            }
            cells.CharacterTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visCharPropRow, true);
            cells.ParagraphTextRuns = TextFormat.GetTextRuns(shape, IVisio.VisRunTypes.visParaPropRow, true);
            cells.TabStops          = TabStopHelper.GetTabStops(shape);
            return(cells);
        }