Example #1
0
 private void settingsRestoreDefaults_Click(object sender, EventArgs e)
 {
     OperationsToPerform.defaultSettings();
     Resets.resetPastCheck();
     errorOutputArea.Text    = "";
     settingsOutputText.Text = "Default Settings Restored";
 }
Example #2
0
 internal void settingsSubmitButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (settingsEntryField.Text == "000000")
         {
             OperationsToPerform.defaultSettings();
             Resets.resetPastCheck();
             errorOutputArea.Text    = "";
             settingsOutputText.Text = "Settings Updated";
         }
         else if (settingsEntryField.Text == "999999")
         {
             OperationsToPerform.allOff();
             Resets.resetPastCheck();
             errorOutputArea.Text    = "";
             settingsOutputText.Text = "Settings Updated";
         }
         else if (Basic_Functions.checkRegexpBool(settingsEntryField.Text, @"[1-8]{4}[1-4][0-9]") == true)
         {
             OperationsToPerform.customSettings(settingsEntryField.Text);
             Resets.resetPastCheck();
             errorOutputArea.Text    = "";
             settingsOutputText.Text = "Settings Updated";
         }
         else if (settingsEntryField.Text == "")
         {
             settingsOutputText.Text = "No code has been entered";
         }
         else if (settingsEntryField.Text.Length < 6)
         {
             settingsOutputText.Text = "Code is too short";
         }
         else
         {
             settingsOutputText.Text = "Incorrect Code";
         }
         Properties.Settings.Default.Save();
     }
     catch
     {
         Basic_Functions.criticalError("Settings Save Failed");
     }
 }