public virtual void Write(ICodeFragment fragment, IOutputCache output) { CommentTemplate comment = (CommentTemplate)fragment; if (comment.IsEmpty()) { return; } foreach (string line in this.SplitLines(comment.Description)) { if (line.TrimStart().StartsWith("/*")) { if (line.EndsWith("*/")) { output.Add(line); } else { output.Add(line.Replace("*/", "*/ //")); } } else { output.Add($"// {line}".Trim()); } output.BreakLine(); } }
public virtual void Write(ICodeFragment fragment, IOutputCache output) { CommentTemplate comment = (CommentTemplate)fragment; if (comment.IsEmpty()) { return; } string[] lines = comment.Description.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); lines.ForEach(line => output.Add("// " + line).BreakLine()); }
public override void Write(ICodeFragment fragment, IOutputCache output) { CommentTemplate comment = (CommentTemplate)fragment; if (comment.IsEmpty()) { return; } if (comment.Type == CommentType.Summary) { output.Add("/// <summary>").BreakLine(); this.SplitLines(comment.Description).ForEach(x => output.Add($"/// {x}".Trim()).BreakLine()); output.Add("/// </summary>").BreakLine(); } else { base.Write(fragment, output); } }
public override void Write(ICodeFragment fragment, IOutputCache output) { CommentTemplate comment = (CommentTemplate)fragment; if (comment.IsEmpty()) { return; } if (comment.Type == CommentType.Summary) { output.Add("/// <summary>").BreakLine(); string[] lines = comment.Description.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); lines.ForEach(x => output.Add("/// ").Add(x).BreakLine()); output.Add("/// </summary>").BreakLine(); } else { base.Write(fragment, output); } }