mirror of
https://github.com/AlexMacocian/WpfExtended.git
synced 2026-07-21 09:29:28 +00:00
7d3c2fbb9b
Testing project for source generator
31 lines
739 B
C#
31 lines
739 B
C#
using System.Collections.Generic;
|
|
|
|
namespace System.Extensions.Templates
|
|
{
|
|
internal sealed class CodeBlockTemplate : CodeTemplate
|
|
{
|
|
public List<string> Lines { get; set; } = new List<string>();
|
|
|
|
public CodeBlockTemplate WithLines(params string[] lines)
|
|
{
|
|
this.Lines.Clear();
|
|
this.Lines.AddRange(lines);
|
|
return this;
|
|
}
|
|
|
|
public CodeBlockTemplate WithLine(string line)
|
|
{
|
|
this.Lines.Add(line);
|
|
return this;
|
|
}
|
|
|
|
public override void Generate(CodeWriter codeWriter)
|
|
{
|
|
foreach(var line in this.Lines)
|
|
{
|
|
codeWriter.AppendLine(line);
|
|
}
|
|
}
|
|
}
|
|
}
|