修改内容如下
|
C# 2::Profile\Attribute\Templates\definition |
\n .if (%isGenerated%) and (%isValidAttribute%) /// <summary>\n .if (%Comment% == "") ///\n .else %comment%\n .endif /// </summary> [%oidDocTag%\n] .if(%customAttributes% != "") [%customAttributes%]\n .endif \[Display(Name = "%Name%")\]\n .if (%Multiple% == false) and (%isIndexer% == false) public [%flags% ]%dataType% %fieldCode%[ = %InitialValue%] { get; set; } .else public [%flags% ]%dataType%[%arraySize%] %fieldCode%[ = %InitialValue%] { get; set; } .endif .endif |
|
C# 2::Profile\Class\Templates\definition |
/// <summary>\n .if (%Comment% == "") ///\n .else %comment%\n .endif /// </summary> [%oidDocTag%\n]\ [%classProperties%\n]\ \[Table("%Code%")\] public [%flags% ][%isPartialType%?partial ]class %Code%[%genericTypeParameters%][ : %inheritanceList%][ %genericTypeConstraints%] { [\ %members%\n ]\ [\ %innerClasses%\n ]\ [\ %innerInterfaces%\n ]\ } |
|
C# 2::Profile\Classifier\Templates\usings |
.unique using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema;\n .if (%isWebServiceClass%) using System.Web; using System.Web.Services; .endif(\n) [%Imports%\n] .endunique |
|
C# 2::Profile\Class\Criteria\Enum\Templates\definition |
.foreach_item(Attributes) \n /// <summary>\n .if (%Comment% == "") ///\n .else %comment%\n .endif /// </summary> [%oidDocTag%\n] .if(%customAttributes% != "") [%customAttributes%]\n .endif \[Display(Name = "%Name%")\] [%definition%] .next(,\n) |
最后效果。
本文介绍了一套用于自动生成C#代码的模板系统,包括类定义、属性定义及枚举类型的生成规则,并展示了如何使用特定语法来定制不同类型的代码元素。
6908

被折叠的 条评论
为什么被折叠?



