摘要:
在CodeSmith中使用CodeTemplateInfo可以获取当前模版的一些信息: 属性 返回值 CodeBehind Gets the full path to the code-behind file for the template (or an empty string if there is no code-behind file). ContentHash... 阅读全文
摘要:
CodeSmith在执行模版时通过调用一些API来完成的,主要经过了以下这几步的操作: l 编译一个模版 l 显示编译错误信息 l 创建一个新的模版实例 l 用元数据填充模版 l 输出结果 下面这段代码显示了这些操作: CodeTemplateCompiler compiler = new CodeTemplateC... 阅读全文