Exemplo n.º 1
0
        private static void ParseContents(XElement contentElem, Comment comment)
        {
            string contents;

            if (contentElem.FirstNode.NodeType == XmlNodeType.Text)
            {
                contents = ((XText)contentElem.FirstNode).Value;
            }
            else
            {
                StringBuilder bldr = new StringBuilder();
                foreach (var paraElem in contentElem.Elements("p"))
                {
                    ParseParagraph(paraElem, bldr);
                }
                contents = bldr.ToString();
            }
            comment.AddTextToContent("", false);
            comment.Contents.InnerXml = contents;
        }