Пример #1
0
        public static List <TextFormat> GetFormat(IVisio.Page page, ShapeIDPairs shapeidpairs, VASS.CellValueType type)
        {
            var shapeids = shapeidpairs.Select(s => s.ShapeID).ToList();

            var charcells      = CharacterFormatCells.GetCells(page, shapeidpairs, type);
            var paracells      = ParagraphFormatCells.GetCells(page, shapeidpairs, type);
            var textblockcells = TextHelper.GetTextBlockCells(page, shapeids, type);

            var page_shapes = page.Shapes;
            var formats     = new List <TextFormat>(shapeidpairs.Count);

            for (int i = 0; i < shapeidpairs.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[shapeidpairs[i].ShapeID];
                format.CharacterTextRuns = TextFormat._get_text_runs(shape, IVisio.VisRunTypes.visCharPropRow, true);
                format.ParagraphTextRuns = TextFormat._get_text_runs(shape, IVisio.VisRunTypes.visParaPropRow, true);

                format.TabStops = TextHelper.GetTabStops(shape);
            }

            return(formats);
        }
Пример #2
0
        public static TextFormat GetFormat(IVisio.Shape shape, VASS.CellValueType type)
        {
            var cells = new TextFormat();

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