Beispiel #1
0
        public XElement Parse(TableBuilder tableBuilder = null)
        {
            var  paragraphs = new XElement("root");
            bool first      = true;

            foreach (var paragraph in Paragraphs)
            {
                int tIndex = tableBuilder == null ? -1 : tableBuilder.GetTableIndexFor(paragraph.Range);

                if (tableBuilder != null && tIndex != -1 && tableBuilder.HasRetrieved(tIndex))
                {
                    continue;
                }
                if (first)
                {
                    CellStyle = GetCellStyle(((Style)paragraph.get_Style()).NameLocal);
                    first     = false;
                }
                var temp = ParseParagraph(paragraph);
                if (temp != null)
                {
                    paragraphs.Add(temp);
                }
            }
            var flush = _listBuilder.Flush();

            if (flush != null)
            {
                paragraphs.Add(flush);
            }
            return(paragraphs);
        }