Esempio n. 1
0
 public void SaveConfig(CodeGenerateInfo cgInfo)
 {
     ConfigNode.Element("company").Value      = cgInfo.Company;
     ConfigNode.Element("category").Value     = cgInfo.Category;
     ConfigNode.Element("generatePath").Value = cgInfo.GenerateResultPath;
     Doc.Save(_path);
 }
        private void InitData()
        {
            _codeGenerateInfo = new CodeGenerateInfo();
            _modelFolder      = System.Configuration.ConfigurationSettings.AppSettings["ModelPath"];
            _controllerFolder = System.Configuration.ConfigurationSettings.AppSettings["ControllerPath"];
            _viewFolder       = System.Configuration.ConfigurationSettings.AppSettings["ViewPath"];

            _mainWindow.LoadCodeGenerateConfig(_codeGenerateInfo);
            txt_ResultPath.Text = _codeGenerateInfo.GenerateResultPath; // System.Configuration.ConfigurationSettings.AppSettings["ResultPath"];
            txt_Company.Text    = _codeGenerateInfo.Company;            //  System.Configuration.ConfigurationSettings.AppSettings["Company"];
            txt_Category.Text   = _codeGenerateInfo.Category;           //  System.Configuration.ConfigurationSettings.AppSettings["Category"];
        }
Esempio n. 3
0
 public void Start(ModelInfo model, CodeGenerateInfo generatorInfo)
 {
     try
     {
         _iCodeGenerator.Init(model, generatorInfo);
         _iCodeGenerator.Do();
         _iCodeGenerator.End();
         MessageBox.Show("生成成功!");
     }
     catch (Exception ex)
     {
         // TODO 唐友辉 2017-10-01 1:13 AM
         // log
     }
 }
Esempio n. 4
0
 public override void Init(ModelInfo model, CodeGenerateInfo generatorInfo)
 {
     base.Init(model, generatorInfo);
 }
Esempio n. 5
0
 public virtual void Init(ModelInfo model, CodeGenerateInfo generatorInfo)
 {
     _modelInfo     = model;
     _generatorInfo = generatorInfo;
 }
Esempio n. 6
0
 public void LoadCodeGenerateConfig(CodeGenerateInfo cgInfo)
 {
     cgInfo.Company            = ConfigNode.Element("company").Value;
     cgInfo.Category           = ConfigNode.Element("category").Value;
     cgInfo.GenerateResultPath = ConfigNode.Element("generatePath").Value;
 }