示例#1
0
        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();
            }
        }
示例#2
0
        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());
        }
示例#3
0
        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);
            }
        }
示例#4
0
        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);
            }
        }