Skip to content

Commit

Permalink
Update CallbacktestForm.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CatGirlsAreLife authored Jul 26, 2018
1 parent 8cf409a commit a69e3bd
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions CallbacktestForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,14 @@ public CallbacktestForm()

private void CheckBox1_CheckedChanged(object sender, System.EventArgs e)
{
if (CheckBox1.Checked == true)
{
callbacksetting1_temp = 1;
}
else if (callbacksetting1_temp > 0)
{
callbacksetting1_temp = 0;
}
callbacksetting1_temp = CheckBox1.Checked ? 1 : callbacksetting1_temp > 0 ? 0 : callbacksetting1_temp;
}

private void CallbacktestForm_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
{
Els_kom_Core.Classes.SettingsFile.Settingsxml.ReopenFile();
if (callbacksetting1 != callbacksetting1_temp)
{
callbacksetting1 = callbacksetting1_temp;
Els_kom_Core.Classes.SettingsFile.Settingsxml.Write("ShowTestMessages", callbacksetting1.ToString());
}
callbacksetting1 = callbacksetting1 != callbacksetting1_temp ? callbacksetting1_temp : callbacksetting1;
Els_kom_Core.Classes.SettingsFile.Settingsxml.Write("ShowTestMessages", callbacksetting1.ToString());
Els_kom_Core.Classes.SettingsFile.Settingsxml.Save();
}

Expand All @@ -43,10 +33,8 @@ private void CallbacktestForm_Load(object sender, System.EventArgs e)
callbacksetting1_temp = 0;
Els_kom_Core.Classes.SettingsFile.Settingsxml.ReopenFile();
int.TryParse(Els_kom_Core.Classes.SettingsFile.Settingsxml.Read("ShowTestMessages"), out callbacksetting1);
if (callbacksetting1 > 0)
{
CheckBox1.Checked = true;
}
// set to true if callbacksetting1 > 0 is evaluated to true.
CheckBox1.Checked = callbacksetting1 > 0;
}
}
}

0 comments on commit a69e3bd

Please sign in to comment.