Esempio n. 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 = TextHelper.GetTabStops(shape);
            }

            return(formats);
        }
Esempio n. 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);
            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);
        }
Esempio n. 3
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);
        }