3
다른 t4 템플릿을 사용하여 this.WriteLine ("Hello, World!") 대신 입력 할 수 있습니다. 그게 가능하니?T4 템플릿 다중 출력
<#@ template language="C#" hostspecific="True" debug="True" #>
<#@ output extension="txt" #>
<#@ include file="T4Toolbox.tt" #>
Sample Content
<# for(int i=7;i<9;i++){
SampleTemplate template = new SampleTemplate();
template.Output.File = @"SubFolder\SampleOutput"+i+".txt";
template.Output.Project = @"..\ClassLibrary2\ClassLibrary2.csproj";
template.Render();
}
#>
<#+
public class SampleTemplate : Template
{
public override string TransformText()
{
this.WriteLine("Hello, World!");
return this.GenerationEnvironment.ToString();
}
}
#>