本文介绍了我可以用T4编程方式从C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写产生C#代码软件。大多是我使用的和StringBuilder。

I am writing software that produces C# code. Mostly I am using StringTemplate and StringBuilder.

有没有办法使用T4模板从我的代码直接?

Is there any way to use T4 templates direct from my code?

推荐答案

介绍了如何在这里做到这一点:了解T4:预处理的文本模板。请注意,它看起来像你需要Visual Studio 2010中生成一个预处理文本模板,但你能够举办预处理文本模板你喜欢的地方 - 包括你的WinForms应用程序中。

Oleg Sych describes how to do this here: Understanding T4: Preprocessed Text Templates. Note that it looks like you'll need Visual Studio 2010 to generate a preprocessed Text Template, but you'll be able to host the preprocessed Text Template wherever you like - including within your WinForms application.

这篇关于我可以用T4编程方式从C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 16:14