Пример #1
0
        public IComment Parse(XmlNode content, bool first, bool last)
        {
            // strip paragraph if there's only one
            if (first && last)
            {
                return new InlineText(PrepareText(content.InnerText, true, true));
            }

            Paragraph paragraph = new Paragraph();

            foreach (var child in parser.Parse(content.ChildNodes))
                paragraph.AddChild(child);

            return paragraph;
        }
Пример #2
0
 public IComment Parse(ICommentParser parser, XmlNode node, bool first, bool last, ParseOptions options)
 {
     var typeAttribute = node.Attributes["type"];
     var listTypeName = typeAttribute == null ? string.Empty : typeAttribute.Value;
     var list = createListForType(listTypeName);
     foreach (XmlNode itemNode in node.SelectNodes("item"))
     {
         Paragraph term = null;
         Paragraph definition = null;
         var termNode = itemNode.SelectSingleNode("term");
         if (termNode != null)
         {
             term = new Paragraph(parser.Parse(termNode.ChildNodes));
         }
         var definitionNode = itemNode.SelectSingleNode("description");
         if (definitionNode != null)
         {
             definition = new Paragraph(parser.Parse(definitionNode.ChildNodes));
         }
         list.Items.Add(new InlineListItem(term, definition));
     }
     return list;
 }
Пример #3
0
 private string FormatParagraph(Paragraph comment)
 {
     return "<p>" + FormatGeneralContainer(comment) + "</p>";
 }
Пример #4
0
 public InlineListItem(Paragraph term, Paragraph definition)
 {
     this.Term = term;
     this.Definition = definition;
 }
Пример #5
0
 public InlineListItem(Paragraph term, Paragraph definition)
 {
     Term = term;
     Definition = definition;
 }