public void setProtection(bool x) { protectionStatus = x; if (x) { Protection.Image = ((System.Drawing.Image)(Properties.Resources.on)); } else { Protection.Image = ((System.Drawing.Image)(Properties.Resources.off)); } Protection.Refresh(); }
private void protectionBtn(object sender, MouseEventArgs e) { if (protectionIsOn()) { Protection.Image = ((System.Drawing.Image)(Properties.Resources.off)); setProtection(false); } else if (!protectionStatus) { Protection.Image = ((System.Drawing.Image)(Properties.Resources.on)); setProtection(true); } Protection.Refresh(); updateSetting(); }