<%@ CodeTemplate Language="C#" TargetLanguage="C#" Description="myFirstTemplate" %>
<%@ Property Name="NameSpace" Type="String" Category="Context" Description="the nameSpace"%>
<%@ Property Name="ClassName" Type="String" Category="Context" Description="the className"%>
using System;
namespace <%=NameSpace%>
{
Class <%=ClassName%>
{
public <%=ClassName%>()
{
}
}
}
然后我们就可以在属性栏目里面看见我们定义的两个模板变量的属性了,如图<%@ Property Name="NameSpace" Type="String" Category="Context" Description="the nameSpace"%>
<%@ Property Name="ClassName" Type="String" Category="Context" Description="the className"%>
using System;
namespace <%=NameSpace%>
{
Class <%=ClassName%>
{
public <%=ClassName%>()
{
}
}
}
可以填上你想要的类空间和名称,点击编译按钮,自动生成一个类,真的很方便,今天就这些!明天继续努力!