/// <summary> /// Handler for click of edit button. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEdit_Click(object sender, EventArgs e) { //Note: when you click button it is sure that it is during edit only na dnot during installation frmGSAParams GSAParamForm = new frmGSAParams(); //LoadConfigurationFromFileToForm(webConfigpath, GSAParamForm); GSAParamForm.LoadConfigurationFromFileToForm(WebConfigPath); DialogResult result = GSAParamForm.ShowDialog(); //show the dialog //if OK save it to file if (result == DialogResult.OK) { GSAConfiguration gc = GSAParamForm.PopulateGSAConfiguration(null); gc.SaveConfigurationsToFile(webConfigpath, false);//do not save the location of custom stylesheet } GSAParamForm.Dispose();//dispose off the form }
public void SaveAllWebAppConfigurationsToFile(GSAConfiguration gc) { string webConfigFilePath = null; foreach (Control c in flowLayoutPanel1.Controls) { TableLayoutPanel tlb = c as TableLayoutPanel; if (tlb != null) { foreach (Control child1 in tlb.Controls) { #region update all checked web applications Label PathLabel = child1 as Label; //In case multiple labels are added if ((PathLabel != null) && (PathLabel.Name.Equals(PATH))) { if (!PathLabel.Text.EndsWith(SLASH)) { webConfigFilePath = PathLabel.Text + SLASH + WEB_CONFIG_FILE; } else { webConfigFilePath = PathLabel.Text + WEB_CONFIG_FILE; } //SaveConfigurationsToFile(gc, webConfigFilePath); gc.SaveConfigurationsToFile(webConfigFilePath, true); //change the settings of the web application as per the "GSA Settings panel" //This will always be called during installation } #endregion update all checked web applications }//end: foreach#1 } } this.Close();//close the form }