3 May 2009 0 Comments

Info on "How to call GAX-based T4 Templates (that have a Property Directive) from standard T4 Templates" posted by tangible

GAT/GAX toolkit has been using property directive in Text Templates like this. <#@ template language = ” C# ” #> <#@ output extension = ” .cs ” #> <#@ property processor = ” PropertyProcessor ” name = ” ClassName ” type = ” System.String ” #> <#@ property processor = ” PropertyProcessor ” name = ” Namespace ” type = ” System.String ” #> namespace <#= Namespace #> {     class <#= ClassName #> {      // more.    } } While this directive is not supported by the DSLTools Host which is the default Host for Text Templates in Visual Studio there is often the question how to call a Template and pass in property values like done here: <#@ include file = ” T4GAXRunner.ttinclude ” #> <#    GetT4GAXRunner().Render( “GAXSample.t4″ ,         new {ClassName= “MyClass” , Namespace= “ns” }); #> < tangible has now posted a Standard DSL-Tools-Host Text Template nick-named “T4GAXRunner” that can call a GAX template and pass in parameters very nicely.

Original post: 
Info on "How to call GAX-based T4 Templates (that have a Property Directive) from standard T4 Templates" posted by tangible

If you liked this post, buy me a beer. A beer cost only 1 Dollar in India.

Leave a Reply