T4 Parameter Passing: You Can’t There from Here

Published 29 October 08 11:51 AM | jons 

The inheritance from TextTransformation is not going to work, at least not directly.  The TextTransformation class has no knowledge of the template location or the host.  I suppose that I could force the template to use the hostspecific="True" parameter on the template directive and pass the host up to the custom class that inherits from the TextTransformation class or use reflection to find the Host property in the derived child class created by the custom tool.  Ugly, ugly, ugly. 

New Comments to this post are disabled

About jons

Jon Stonecash is a technology consultant and has been designing, developing, and testing various kinds of software for such a long time that he has had the opportunity to make most of the serious software development mistakes at least once. His long term interests center about databases and the aspects of the application that handle data access and business logic. He is also interested in the tools that assist the development process, particularly code generation.