private void enablebutton_Click(object sender, EventArgs e)
{
// Check if the code is OK
General.AccessEnabled = typedcode.EndsWith(CODE1) || typedcode.EndsWith(CODE2);
typedcode = "";
if(General.AccessEnabled)
{
General.Sounds.Play("accessgranted");
grantedlabel.Text = "ENABLED";
}
else
{
General.Sounds.Play("accessdenied");
grantedlabel.Text = "DENIED";
}
texttimer.Stop();
flashstate = false;
accesslabel.Visible = false;
grantedlabel.Visible = false;
progress1.ColorBackground = ColorIndex.ControlColorNegative;
progress2.ColorBackground = ColorIndex.ControlColorNegative;
progress3.ColorBackground = ColorIndex.ControlColorNegative;
progress4.ColorBackground = ColorIndex.ControlColorNegative;
progress5.ColorBackground = ColorIndex.ControlColorNegative;
accesslabel.ColorText = ColorIndex.ControlColorNegative;
grantedlabel.ColorText = ColorIndex.ControlColorNegative;
UpdateColors();
enablestate = 0;
enabletimer.Start();
}