Oleg --
Regarding the change that would be required to existing code...
>>>The fix would be simple - replace RenderCore declaration with TransformText and make the method return this.GenerationEnvironment.ToString() because RenderCore was void and TransformText has to return a string.
...that change sounds fine to me, I think, if the change to existing code is as I think it is-- minimal.
Can you explain a bit more from an implementation-level exactly what actual code changes would be needed to existing templates?
Is it as simple as changing this...
protected override void RenderCore()
...to this...
protected override string TransformText()
{
...blah
return this.GenerationEnvironment.ToString();
}
...???
For example, I have the following...
The file "_T4CodeUtility02File.tt" includes/uses the file "_T4CodeUtility02Generator.tt".
The file "_T4CodeUtility02Generator.tt" includes/uses the file "_T4CodeUtility02Template.tt".
The code is something like the following.
Inside "_T4CodeUtility02File.tt" I call...
myGenerator.Run();
Inside "_T4CodeUtility02Generator.tt" I have...
protected override void RunCore()
...and...
myCodeUtility02Template.RenderToFile(myFileNameTemp);
Inside "_T4CodeUtility02Template.tt" I have...
protected override void RenderCore()
...and that works fine.
So, my understanding is that inside "_T4CodeUtility02Template.tt" I replace this...
protected override void RenderCore()
...with this...
protected override void TransformText()
...and inside "TransformText()" I would call...
this.GenerationEnvironment.ToString()
...at the end??? Or where?
(My reference implementation is my most recent "Northwind01_T4Sample_" at the link http://t4toolbox.codeplex.com/SourceControl/PatchList.aspx where the Patches are.)
Thank you.
-- Mark Kamoski