示例#1
0
        static void AddDocComments(docMember dm, CodeCommentStatementCollection comments, string[] extra = null)
        {
            if (dm != null && dm.summary != null)
            {
                comments.Add(new CodeCommentStatement("<summary>", true));
                var noIndent = StringFunctions.TrimTrimIndentsOfArray(dm.summary.Text);
                if (noIndent != null)
                {
                    foreach (var item in noIndent)
                    {
                        comments.Add(new CodeCommentStatement(item, true));
                    }
                }

                if (extra != null && extra.Length > 0)
                {
                    foreach (var c in extra)
                    {
                        comments.Add(new CodeCommentStatement(c, true));
                    }
                }

                comments.Add(new CodeCommentStatement("</summary>", true));
            }
            else if (extra != null && extra.Length > 0)
            {
                comments.Add(new CodeCommentStatement("<summary>", true));
                foreach (var c in extra)
                {
                    comments.Add(new CodeCommentStatement(c, true));
                }
                comments.Add(new CodeCommentStatement("</summary>", true));
            }
        }
示例#2
0
        static string GetReturnComment(docMember m)
        {
            if (m == null || m.returns == null || m.returns.Text == null || m.returns.Text.Length == 0)
            {
                return(null);
            }

            var noIndent = StringFunctions.TrimTrimIndentsOfArray(m.returns.Text);

            return(String.Join(Environment.NewLine, noIndent));
        }
示例#3
0
 static void AddDocComments(docMember dm, CodeCommentStatementCollection comments, string[] extra = null)
 {
     if (dm != null && dm.summary != null)
     {
         if (extra != null && extra.Length > 0)
         {
             comments.Add(new CodeCommentStatement(StringFunctions.IndentedArrayToString(dm.summary.Text.Union(extra)), true));
         }
         else
         {
             comments.Add(new CodeCommentStatement(StringFunctions.IndentedArrayToString(dm.summary.Text), true));
         }
     }
     else if (extra != null && extra.Length > 0)
     {
         comments.Add(new CodeCommentStatement(StringFunctions.IndentedArrayToString(extra), true));
     }
 }
示例#4
0
        static string GetParameterComment(docMember m, string name)
        {
            if (m == null || m.param == null)
            {
                return(null);
            }

            var mc = m.param.SingleOrDefault(d => d.name == name);

            if (mc == null || mc.Text == null || mc.Text.Length == 0)
            {
                return(null);
            }

            var noIndent = StringFunctions.TrimTrimIndentsOfArray(mc.Text);

            return(String.Join(Environment.NewLine, noIndent));
        }
示例#5
0
        static void AddDocComments(docMember member, CodeCommentStatementCollection comments)
        {
            if (member != null && comments != null)
            {
                if (member.summary != null)
                {
                    comments.Add(new CodeCommentStatement("<summary>", true));
                    var noIndent = StringFunctions.TrimTrimIndentsOfArray(member.summary.Text);
                    if (noIndent != null)
                    {
                        foreach (var item in noIndent)
                        {
                            comments.Add(new CodeCommentStatement(item, true));
                        }
                    }

                    comments.Add(new CodeCommentStatement("</summary>", true));
                }
            }
        }