/// <summary> /// 对象的值赋给页面 /// </summary> /// <param name="formConfig"></param> private void setFormConfig(FormConfig formConfig) { backupLocation.Text = formConfig.BackUpLocation; catalinaOutLocation.Text = formConfig.CatalinaOutLocation; deployAs.Text = formConfig.DeployAs; ip.Text = formConfig.Ip; localBackup.Checked = formConfig.LocalBackUp; userName.Text = formConfig.UserName; password.Text = formConfig.Password; port.Text = formConfig.Port.ToString(); projectName.Text = formConfig.ProjectName; serverBackup.Checked = formConfig.ServerBackUp; shellLocation.Text = formConfig.ShellLocation; webappsLocation.Text = formConfig.WebappsLocation; stopTag.Text = formConfig.StopTag; includeWebFile.Checked = formConfig.IncludeWebFile; includeByteCode.Checked = formConfig.IncludeByteCode; includeConfig.Checked = formConfig.IncludeConfig; includeLib.Checked = formConfig.IncludeLib; }
/// <summary> /// 根据配置文件获取配置 /// </summary> /// <param name="config"></param> /// <param name="server"></param> /// <returns></returns> private FormConfig generateFormConfig(Config config, Server server) { FormConfig formConfig = new FormConfig(); formConfig.BackUpLocation = server.BackUpLocation; formConfig.CatalinaOutLocation = server.CatalinaOutLocation; formConfig.DeployAs = server.DeployAs; formConfig.Ip = server.Ip; formConfig.LocalBackUp = config.LocalBackUp; formConfig.Password = server.Password; formConfig.Port = server.Port; formConfig.ProjectName = config.ProjectName; formConfig.ServerBackUp = config.ServerBackUp; formConfig.ShellLocation = server.ShellLocation; formConfig.UserName = server.UserName; formConfig.WebappsLocation = server.WebappsLocation; formConfig.StopTag = server.StopTag; formConfig.IncludeWebFile = server.IncludeWebFile; formConfig.IncludeByteCode = server.IncludeByteCode; formConfig.IncludeConfig = server.IncludeConfig; formConfig.IncludeLib = server.IncludeLib; return(formConfig); }
/// <summary> /// 页面上的值转换为对象 /// </summary> /// <returns></returns> private FormConfig getFormConfig() { FormConfig formConfig = new FormConfig(); formConfig.BackUpLocation = backupLocation.Text; formConfig.CatalinaOutLocation = catalinaOutLocation.Text; formConfig.DeployAs = deployAs.Text; formConfig.Ip = ip.Text; formConfig.LocalBackUp = localBackup.Checked; formConfig.Password = password.Text; formConfig.Port = Int16.Parse(port.Text); formConfig.ProjectName = projectName.Text; formConfig.ServerBackUp = serverBackup.Checked; formConfig.ShellLocation = shellLocation.Text; formConfig.UserName = userName.Text; formConfig.WebappsLocation = webappsLocation.Text; formConfig.StopTag = stopTag.Text; formConfig.IncludeWebFile = includeWebFile.Checked; formConfig.IncludeByteCode = includeByteCode.Checked; formConfig.IncludeConfig = includeConfig.Checked; formConfig.IncludeLib = includeLib.Checked; return(formConfig); }