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)); } }
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)); }
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)); } }
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)); }
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)); } } }