private void DlgAbpCoder_FormClosing(object sender, FormClosingEventArgs e) { _setting.ModelName = txtModel.Text?.Trim(); _setting.CtlSubPath = txtSubCtlPath.Text?.Trim(); _setting.AppSubPath = txtSubAppPath.Text?.Trim(); VbpCoderSetting.SaveSetting(); }
private void DlgUsingSetting_Load(object sender, EventArgs e) { var _setting = VbpCoderSetting.GetValue(); txtApplication.Text = _setting.AppUsing; txtController.Text = _setting.CtlUsing; txtDto.Text = _setting.DtoUsing; txtManager.Text = _setting.ManagerUsing; }
private void BtnSave_Click(object sender, EventArgs e) { var setting = VbpCoderSetting.GetValue(); setting.AppUsing = txtApplication.Text; setting.CtlUsing = txtController.Text; setting.DtoUsing = txtDto.Text; setting.ManagerUsing = txtManager.Text; VbpCoderSetting.SaveSetting(); DialogResult = DialogResult.OK; }
public string GetInterfaceText(List <IAbpAppItem> items = null) { var lname = _modelName.ToFirstLettleLcase(); var _name = _modelName.ToUnderLineStringcase(); var name = _modelName; var baseClase = AbpSolutionBll.GetBaseClassName(AbpProjectType.Application);; string appNameSpace = GetAppServiceNameSapce(); var result = tplInterface.Replace("$name$", name) .Replace("$_name$", _name) .Replace("$lname$", lname) .Replace("$app.nameSapce$", appNameSpace) .Replace("$baseClass$", baseClase) .Replace("$items$", GetInterfaceItemsCode(items)) .Replace("$using$", VbpCoderSetting.GetValue().AppUsing) .Replace("$root.name.space$", AbpSolutionBll.GetRootNameSpace()) .Replace("$usingDto$", $"using {GetDtoNameSapce()};"); return(result); }
public string GetServiceText(List <IAbpAppItem> items = null) { var lname = _modelName.ToFirstLettleLcase(); var _name = _modelName.ToUnderLineStringcase(); var name = _modelName; var baseClase = AbpSolutionBll.GetBaseClassName(AbpProjectType.Domain);; string managerNameSpace = GetManagerNameSapce(); var result = tpl.Replace("$name$", name) .Replace("$_name$", _name) .Replace("$lname$", lname) .Replace("$manager.name.space$", managerNameSpace) .Replace("$baseClass$", baseClase) .Replace("$using$", VbpCoderSetting.GetValue().ManagerUsing) //.Replace("$items$", GetServiceItemsCode(items)) .Replace("$root.name.space$", AbpSolutionBll.GetRootNameSpace()) ; return(result); }
public string GetText(List <IAbpCtlItem> ctlItems = null) { var lname = _modelName.ToFirstLettleLcase(); var _name = _modelName.ToUnderLineStringcase(); var name = _modelName.ToFirstLettleUpcase(); var ctlNameSpace = string.IsNullOrWhiteSpace(_subPath) ? _rootSpaceName : $"{_rootSpaceName}.{_subPath}"; var oAbpAppliation = new AbpApplication(_subPath, _modelName); var result = tpl.Replace("$name$", name) .Replace("$_name$", _name) .Replace("$lname$", lname) .Replace("$ctl.nameSapce$", ctlNameSpace) .Replace("$baseClass$", _baseClase) .Replace("$usingDto$", $"using {oAbpAppliation.GetDtoNameSapce()};") .Replace("$using$", VbpCoderSetting.GetValue().CtlUsing) .Replace("$usingAppService$", $"using {oAbpAppliation.GetAppServiceNameSapce()};"); result = result.Replace("$items$", Items2Code(ctlItems)); return(result); }
private string GetDtoCode(string dtoName) { var code = tplDto.Replace("$root.name.space$", AbpSolutionBll.GetRootNameSpace()) .Replace("$dtoname$", dtoName) .Replace("$using$", VbpCoderSetting.GetValue().DtoUsing) .Replace("$dto.name.space$", GetDtoNameSapce()); if (dtoName.StartsWith("Get") && dtoName.EndsWith("Input")) { code = code.Replace("$some.sample.code$", tplGetInputDtoSampleCode); } if (dtoName.StartsWith("Get") && dtoName.EndsWith("Output")) { code = code.Replace("$some.sample.code$", "public string Code {get;set;}"); } if (dtoName.StartsWith("Put") || dtoName.StartsWith("Abandon")) { code = code.Replace("$some.sample.code$", "public byte[] RowVersion { get; set; }"); } code = code.Replace("$some.sample.code$", ""); return(code); }
private void DlgAbpCoder_Load(object sender, EventArgs e) { BtnSelectAll_Click(this, null); _setting = VbpCoderSetting.GetValue(); }