-
Notifications
You must be signed in to change notification settings - Fork 0
/
CallbacktestForm.cs
57 lines (49 loc) · 1.82 KB
/
CallbacktestForm.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Copyright (c) 2014-2018, Els_kom org.
// https://github.com/Elskom/
// All rights reserved.
// license: MIT, see LICENSE for more details.
namespace callbacktest_plugin
{
using System;
using System.Windows.Forms;
using Elskom.Generic.Libs;
public partial class CallbacktestForm : Form
{
private int callbacksetting1;
private int callbacksetting1Temp;
public CallbacktestForm() => this.InitializeComponent();
private void CheckBox1_CheckedChanged(object sender, EventArgs e)
{
if (this.CheckBox1.Checked == true)
{
this.callbacksetting1Temp = 1;
}
else if (this.callbacksetting1Temp > 0)
{
this.callbacksetting1Temp = 0;
}
}
private void CallbacktestForm_FormClosing(object sender, FormClosingEventArgs e)
{
SettingsFile.Settingsxml.ReopenFile();
if (this.callbacksetting1 != this.callbacksetting1Temp)
{
this.callbacksetting1 = this.callbacksetting1Temp;
SettingsFile.Settingsxml.Write("ShowTestMessages", this.callbacksetting1.ToString());
}
SettingsFile.Settingsxml.Save();
}
private void CallbacktestForm_Load(object sender, EventArgs e)
{
this.callbacksetting1 = 0;
this.callbacksetting1Temp = 0;
SettingsFile.Settingsxml.ReopenFile();
int.TryParse(SettingsFile.Settingsxml.Read("ShowTestMessages"), out this.callbacksetting1);
if (this.callbacksetting1 > 0)
{
this.CheckBox1.Checked = true;
}
}
private void Label1_Click(object sender, EventArgs e) => this.CheckBox1.Checked = this.CheckBox1.Checked ? false : true;
}
}