1

我正在使用 Visual Studio 2012,我想创建一些模板,即。当我创建一个新的 C# 类、javascript 文件等时,我想要一个自定义模板,以便它具有标准的公司版权标题、布局等。

我以前在 VS 中作为 ItemTemplates 和 ProjectTemplates 的一部分做过这个,但它有点乱。有没有更简单的方法来做到这一点?

我在 VS 中使用 resharper,因此任何方式都可以简化流程。

我也想为 SQL Management Studio 做类似的事情,我假设模板过程是相似的。

4

1 回答 1

2

You can setup file header text in resharper options: Resharper -> Options -> Code Editing -> File Header Text. After this create formater or edit existing in Resharper -> Options -> Code Editing -> Code Cleanup and enable there option update file header. So if you run formater after that, it will add the header. To run formater you can use Ctrl + Alt + F. Additionaly formater reformat your code according to code style configuration. You can read more about this here.
But unfortunately I don't know is there a way to share this with SQL Management Studio.

于 2012-10-11T13:27:13.657 回答