Skip to content

Commit

Permalink
Create CallbacktestForm.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
CatGirlsAreLife authored Jul 26, 2018
1 parent b1a6bac commit 729d8d6
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions CallbacktestForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright (c) 2014-2018, Els_kom org.
// https://github.com/Elskom/
// All rights reserved.
// license: MIT, see LICENSE for more details.

namespace callbacktest_plugin
{
public partial class CallbacktestForm : System.Windows.Forms.Form
{
public CallbacktestForm()
{
InitializeComponent();
}
internal int callbacksetting1;
internal int callbacksetting1_temp;

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

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());
}
Els_kom_Core.Classes.SettingsFile.Settingsxml.Save();
}

private void CallbacktestForm_Load(object sender, System.EventArgs e)
{
callbacksetting1 = 0;
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;
}
}
}
}

0 comments on commit 729d8d6

Please sign in to comment.