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);
    }

  • 相关阅读:
    转(一万小时定律的文章): const 与 readonly区别...
    项目中报错邮件方法
    Windows Phone(一) 正式开发之前的准备资料(主要注册开发者账号,手机解锁,激活码,程序部署)
    转(ASP.NET页面缓存)
    部署XAP时,部署工具提示部署无效,求解决!
    jQuery 1
    DOMform
    jQuery 2 一些常用的函数
    jQuery 6 层次选择器
    jQuery 3 对象转换
  • 原文地址:https://www.cnblogs.com/fjchenq/p/525287.html
Copyright © 2011-2022 走看看