我想在創建所有.cs和.xml文件時添加創建者姓名。所以,我可以使用Eclipse如下,但我不能在Visual Studio中使用此在C#中自動添加作者姓名
窗口 - >首選項 - >爪哇 - >代碼樣式 - >代碼模板
/**
* @author ${user}
*
* ${tags}
*/
我開以及如何做到這一點的建議。
我想在創建所有.cs和.xml文件時添加創建者姓名。所以,我可以使用Eclipse如下,但我不能在Visual Studio中使用此在C#中自動添加作者姓名
窗口 - >首選項 - >爪哇 - >代碼樣式 - >代碼模板
/**
* @author ${user}
*
* ${tags}
*/
我開以及如何做到這一點的建議。
您可以更改通常下找到了適合自己的類模板:
C:\ Program Files文件(x86)的\微軟的Visual Studio 版 \ Common7 \ IDE \的ItemTemplate \ CSHARP \
事情是這樣的:
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
/**
* @author $username$
*
* @date - $time$
*/
namespace $rootnamespace$
{
class $safeitemrootname$
{
}
}
模板參數的完整列表,您可以鰭d Here。
在VS2015位於CS文件:
C:\ Program Files文件(x86)的\微軟的Visual Studio 14.0 \ Common7 \ IDE \的ItemTemplate \ CSHARP \代碼\ 1033 \ Class.cs
你可以創建代碼片段,這將爲你做到這一點。 – SeM
看到這:https://stackoverflow.com/questions/9139571/adding-author-name-in-document-header-using-stylecop – PaulF