Пример #1
0
        private void btnGen_Click(object sender, EventArgs e)
        {
            SaveItemInfos();
            SaveClassItemInfo();

            if (cmbModels.Value != null)
            {
                UIProject project = cmbModels.Value as UIProject;
                if (project != null)
                {
                    try
                    {
                        Project selectedProject = cmbProjects.Value as Project;
                        project.GenerateCode(_curEntityInfo, _config, selectedProject, GetProperty(false), _classInfo);
                        this.Close();
                    }
                    catch (CompileException cex)
                    {
                        FrmCompileResault.ShowCompileResault(cex.Code, cex.ToString(), "编译错误");
                    }
                    catch (Exception ex)
                    {
                        FrmCompileResault.ShowCompileResault(null, ex.ToString(), "编译错误");
                        return;
                    }
                }
            }
        }
Пример #2
0
 private void FrmUIGenerater_Load(object sender, EventArgs e)
 {
     gvMember.AutoGenerateColumns = false;
     try
     {
         LoadInfo();
     }
     catch (Exception ex)
     {
         FrmCompileResault.ShowCompileResault(null, ex.ToString(), "加载模版失败");
         this.Close();
     }
     CreateClassItem();
     CreateItems();
     LoadItemCache();
     LoadClassItemCache();
     BindUIModleInfo(_classUIConfig, _classInfo);
     BindItems(_curEntityInfo.Propertys);
     this.Text = "UI界面生成-" + _curEntityInfo.ClassName + ToolVersionInfo.ToolVerInfo;
 }
Пример #3
0
        /// <summary>
        /// ÏÔʾ´íÎó
        /// </summary>
        /// <param name="code">´úÂë</param>
        /// <param name="error">´íÎó</param>
        /// <param name="title">±êÌâ</param>
        public static void ShowCompileResault(string code, string error, string title)
        {
            FrmCompileResault frm = new FrmCompileResault();

            if (!string.IsNullOrEmpty(code))
            {
                frm.txtCode.Text = code;
            }
            else
            {
                frm.spInfo.Panel1Collapsed = true;
            }
            if (!string.IsNullOrEmpty(error))
            {
                frm.txtError.Text = error;
            }
            else
            {
                frm.spInfo.Panel2Collapsed = true;
            }
            frm.Text = title + ToolVersionInfo.ToolVerInfo;
            frm.ShowDialog();
        }