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"]; }
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 } }
public override void Init(ModelInfo model, CodeGenerateInfo generatorInfo) { base.Init(model, generatorInfo); }
public virtual void Init(ModelInfo model, CodeGenerateInfo generatorInfo) { _modelInfo = model; _generatorInfo = generatorInfo; }
public void LoadCodeGenerateConfig(CodeGenerateInfo cgInfo) { cgInfo.Company = ConfigNode.Element("company").Value; cgInfo.Category = ConfigNode.Element("category").Value; cgInfo.GenerateResultPath = ConfigNode.Element("generatePath").Value; }