private void buttonOK_Click(object sender, EventArgs e) { string key = this.Tag as string; ConfigManager manager = AppManager.ConfigManager; ConfigEditor editor = this.Owner as ConfigEditor; if (editor != null) { editor.Changed = true; AppManager.ConfigManager.AppConfigChanged = true; } StringBuilder formula = new StringBuilder(); string[] lines = formulaTextBox.Lines; for (int i = 0; i < lines.Length; i++) { formula.Append(lines[i]); } if (key != null) { switch (key) { case "S17": manager.FormulaSolarVSG = formula.ToString(); break; case "P02": manager.FormulaSolarKW = formula.ToString(); break; case "P06": manager.Formula1 = formula.ToString(); break; case "P07": manager.Formula2 = formula.ToString(); break; case "P08": manager.Formula3 = formula.ToString(); break; case "P09": manager.Formula4 = formula.ToString(); break; case "P10": manager.Formula5 = formula.ToString(); break; default: break; } } Close(); }
protected override int Execute(ActionData data) { try { ConfigEditor dialog = new ConfigEditor(); dialog.ShowDialog(AppManager.MainForm); } catch (Exception ex) { AppExtension.PrintStackTrace(ex); } return(0); }
private void buttonOK_Click(object sender, EventArgs e) { ConfigEditor editor = this.Owner as ConfigEditor; if (editor != null) { editor.Changed = true; AppManager.ConfigManager.AppConfigChanged = true; } RowValues.SolarPulse = (int)pulseUpDown.Value; RowValues.HeatCapacity20 = double.Parse(heatCapacityText.Text, CultureInfo.CurrentCulture); Close(); }
private void buttonOK_Click(object sender, EventArgs e) { ConfigEditor editor = this.Owner as ConfigEditor; if (editor != null) { editor.Changed = true; AppManager.ConfigManager.AppConfigChanged = true; } RowValues.BurnerMinPower = (double)minUpDown.Value; RowValues.BurnerMaxPower = (double)maxUpDown.Value; Close(); }
private void buttonOK_Click(object sender, EventArgs e) { ConfigEditor editor = this.Owner as ConfigEditor; if (editor != null) { editor.Changed = true; AppManager.ConfigManager.AppConfigChanged = true; } RowValues.Temperature = (double)temperatureUpDown.Value; RowValues.Level = (double)levelUpDown.Value; RowValues.Gradient = (double)gradientUpDown.Value; Close(); }
private void buttonOK_Click(object sender, EventArgs e) { double longitude; double latitude; if ((double.TryParse(longitudeTextBox.Text, out longitude) && (double.TryParse(longitudeTextBox.Text, out latitude)))) { ConfigEditor editor = this.Owner as ConfigEditor; if (editor != null) { editor.Changed = true; AppManager.ConfigManager.AppConfigChanged = true; } RowValues.Longitude = longitude; RowValues.Latitude = latitude; Close(); } else { longitudeTextBox.Text = RowValues.Longitude.ToString(CultureInfo.CurrentCulture); latitudeTextBox.Text = RowValues.Latitude.ToString(CultureInfo.CurrentCulture); } }