private void aPISettingsToolStripMenuItem_Click(object sender, EventArgs e) { using (var f = new frmApiConfig(C)) { if (f.ShowDialog() == DialogResult.OK) { C.ApiSettings = f.ApiConfiguration; C.Save(Program.AppPath); MessageBox.Show("API Settings saved", "API Settings", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }
/// <summary> /// Configures the API /// </summary> private static void Configure() { var C = Config.GetDefaults(); MessageBox.Show("Invalid Configuration. Please set your API values", "Invalid API settings", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); var f = new frmApiConfig(C); Application.Run(f); if (f.DialogResult == DialogResult.OK) { C.ApiSettings = f.ApiConfiguration; C.Save(AppPath); Application.Restart(); } }