zoukankan
html css js c++ java
添加文件Node
private
XmlElement AddFileNode(XmlElement rootNode,
string
filename)
{
XmlElement node
=
docOutput.CreateElement(
"
File
"
);
Trace.WriteLine(
string
.Format(
"
\t*File Created: {0}
"
, filename));
PerformStep();
XmlAttribute attName
=
docOutput.CreateAttribute(
"
name
"
);
attName.Value
=
filename;
node.Attributes.Append(attName);
XmlAttribute attTime
=
docOutput.CreateAttribute(
"
startTime
"
);
attTime.Value
=
DateTime.Now.ToFileTime().ToString();
node.Attributes.Append(attTime);
rootNode.AppendChild(node);
return
node;
}
AddFileNode(commonNode,
"
EntityKeyBaseCore.generated.cs
"
);
this
.GetTemplate(
"
EntityKeyBaseCore.generated.cst
"
).SetProperty(
"
BLLNameSpace
"
, BLLNameSpace);
this
.RenderToFile(
"
EntityKeyBaseCore.generated.cst
"
, rootPathBLL
+
"
\\EntityKeyBaseCore.generated.cs
"
,
true
);
if
(
!
File.Exists(rootPathBLL
+
"
\\EntityKeyBase.cs
"
))
{
AddFileNode(commonNode,
"
EntityKeyBase.cs
"
);
this
.GetTemplate(
"
EntityKeyBase.cst
"
).SetProperty(
"
BLLNameSpace
"
, BLLNameSpace);
this
.RenderToFile(
"
EntityKeyBase.cst
"
, rootPathBLL
+
"
\\EntityKeyBase.cs
"
,
true
);
}
public
void
RenderToFile(
string
templateName,
string
path,
bool
overwrite)
{
this
._CurrentFileName
=
path;
this
.GetTemplate(templateName).RenderToFile(path, overwrite);
this
._counter
++
;
}
public
CodeTemplate GetTemplate(
string
templateType)
{
return
(CodeSmith.Engine.CodeTemplate)_CodeTemplates[templateType];
}
public
MoM.Templates.CommonSqlCode GetTemplateBase(
string
templateType)
{
return
(MoM.Templates.CommonSqlCode) GetTemplate(templateType);
}
查看全文
相关阅读:
【转】一句话设计模式
【转】Bad Smell(代码的坏味道)
【转】[重构]Primitive Obsession
【转】22种代码的坏味道,一句话概括
【转】C#中的implicit 和 explicit
【转】100本最棒的英文侦探小说
[转]Visual Studio调试之符号文件
【转】简要分析unity3d中剪不断理还乱的yield
apache https配置步骤
apache https配置步骤
原文地址:https://www.cnblogs.com/fjchenq/p/525287.html
最新文章
linux命令-mount挂载umount卸载
linux命令-mke2fs
linux命令-fdisk分区
linux命令-du查看占用磁盘空间大小
linux命令-df查看磁盘命令
linux命令-sudo普通用户拥有root权限
linux命令-su切换用户
linux命令-passwd
高阶函数 :能够把函数当成参数传递的就是高阶函数 (map reduce sorted filter )
匿名函数 ( lambda表达式 )
热门文章
闭包的特点
闭包函数
函数的嵌套
nonlocal 修改局部变量
locals 和 globals
python基础小练习
函数名的使用/命名空间
函数定义
【转】UML中的几种关系详细解析
【转】一句话解释设计模式
Copyright © 2011-2022 走看看