修改系统模版路径:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\2052
新加自己的模版路径:
参考系统模版,复制然后修改成自己的模版:
C:\Users\Administrator\Documents\Visual Studio 2013\Templates\ItemTemplates
//YCFStock.vstemplate
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item">
<TemplateData>
<DefaultName>Class.cs</DefaultName>
<Name>YCFStock类</Name>
<Description>YCF.Stock项目创建类空模版</Description>
<ProjectType>CSharp</ProjectType>
<SortOrder>89</SortOrder>
<Icon>__TemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<References>
<Reference>
<Assembly>System</Assembly>
</Reference>
</References>
<ProjectItem SubType="Code" TargetFileName="$fileinputname$.cs" ReplaceParameters="true">Class.cs</ProjectItem>
</TemplateContent>
</VSTemplate>
//Class.cs
/* ==============================================================================
* 功能描述:$safeitemrootname$
* 创 建 者:XXX
* 创建日期:$time$
* CLR Version :$clrversion$
* ==============================================================================*/
using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$using YCF.Stock.Utilities.ExtensionHelper;
using YCF.Stock.Utilities.ExceptionHeper;
using YCF.Stock.Utilities.StringHelper;
using YCF.Stock.Core.Entities;
namespace $rootnamespace$
{
public class $safeitemrootname$
{
public $safeitemrootname$(){}
}
}
效果: