Esempio n. 1
0
        internal static MarkdownList ToMDList(DotNetCommentList commentList, DotNetMember parent = null)
        {
            MarkdownList markdownList = new MarkdownList(isNumbered: commentList.IsNumbered);

            foreach (DotNetCommentListItem commentItem in commentList.Items)
            {
                MarkdownLine text = new MarkdownLine();
                if (commentItem.Term == null && commentItem.Description == null)
                {
                    markdownList.Add(text);
                    continue;
                }

                if (commentItem.Term == null)
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Description, parent);
                }
                else if (commentItem.Description == null)
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Term, parent);
                }
                else
                {
                    text = DotNetCommentGroupToMarkdownLine(commentItem.Term, parent);
                    text.Add(": ");
                    text.Concat(DotNetCommentGroupToMarkdownLine(commentItem.Description, parent));
                }
                markdownList.Add(text);
            }

            return(markdownList);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns the first line of comments produced by the group.
        /// Intended for groups that boil down to a single line.
        /// </summary>
        internal static MarkdownLine DotNetCommentGroupToMarkdownLine(DotNetCommentGroup group, DotNetMember parent = null)
        {
            MarkdownLine line = new MarkdownLine();

            if (group == null)
            {
                return(line);
            }

            foreach (DotNetComment comment in group.Comments)
            {
                line.Concat(DotNetCommentsToLine(comment, parent));
            }
            return(line);
        }
Esempio n. 3
0
 internal static IMarkdownInSection DotNetCommentGroupToMarkdown(DotNetCommentGroup group, DotNetMember parent = null)
 {
     if (group.Tag == CommentTag.See || group.Tag == CommentTag.SeeAlso)
     {
         MarkdownLine line = new MarkdownLine();
         foreach (DotNetComment comment in group.Comments)
         {
             line.Concat(DotNetCommentsToLine(comment, parent));
         }
         return(line);
     }
     else
     {
         MarkdownParagraph paragraph = new MarkdownParagraph();
         foreach (DotNetComment comment in group.Comments)
         {
             DotNetCommentsFillParagraph(paragraph, comment, parent);
         }
         return(paragraph);
     }
 }