private void frmMain_Load(object sender, EventArgs e) { //Only works for deployment environment. Remove below line for testing. SetAddRemoveProgramsIcon(); Settings.Default.Reload(); if (Settings.Default.configuration == true) { using (frmConfiguration configForm = new frmConfiguration()) { configForm.ShowDialog(); } } validateSettings(); lblVersion.Text = "Version " + Settings.Default.version; }
/// <summary> /// Deletes the set settings, then asks the user if they want to reconfigure the settings now or on next launch. /// </summary> /// <param name="sender">frmMain</param> /// <param name="e">mnuEditRemove</param> private void mnuEditRemove_Click(object sender, EventArgs e) { var selection = MessageBox.Show("Are you sure you wish to reset the configuration \nfile back to defaults? This will remove " + "ALL settings.", "Remove Settings?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (selection == DialogResult.Yes) { Settings.Default.Reset(); Settings.Default.Save(); validateSettings(); var selection2 = MessageBox.Show("Do you wish run the first time configuration now?" + "\nNote: If not run now, you will still see first time configuration panel on next launch.", "Reset now?", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (selection2 == DialogResult.Yes) { using (frmConfiguration configForm = new frmConfiguration()) { configForm.ShowDialog(); validateSettings(); } } } }