コード例 #1
0
        private void btn_alert_Click(object sender, EventArgs e)
        {
            RectButton btn = sender as RectButton;
            XElement   cfg = Program.curr_cfg;

            if (btn.Name == "btn_turnon_alert")
            {
                if (b_turnon_alert)
                {
                    cfg.SetElementValue("turnon_alert", "OFF");
                }
                else
                {
                    cfg.SetElementValue("turnon_alert", "ON");
                }
                UpdateUI();
                bDirty = true;
            }
            if (btn.Name == "btn_stop_onalert")
            {
                if (b_stop_onalert)
                {
                    cfg.SetElementValue("stop_onalert", "OFF");
                }
                else
                {
                    cfg.SetElementValue("stop_onalert", "ON");
                }
                UpdateUI();
                bDirty = true;
            }
            if (btn.Name == "btn_show_alert")
            {
                if (b_show_alert)
                {
                    cfg.SetElementValue("show_alert", "OFF");
                }
                else
                {
                    cfg.SetElementValue("show_alert", "ON");
                }
                UpdateUI();
                bDirty = true;
            }
            if (btn.Name == "btn_manual_reset")
            {
                if (b_manual_reset)
                {
                    cfg.SetElementValue("manual_reset", "OFF");
                }
                else
                {
                    cfg.SetElementValue("manual_reset", "ON");
                }
                UpdateUI();
                bDirty = true;
            }
        }
コード例 #2
0
 private void nd_1_Click(object sender, EventArgs e)
 {
     if (sender is RectButton)
     {
         RectButton btn = (sender as RectButton);
         if (btn.Name.IndexOf("nd_") == 0)
         {
             all_sel  = false;
             curr_sel = int.Parse(btn.Name.Remove(0, 3));
             btn_refreshreg_Click(null, null);
         }
     }
     UpdateDisplay(false);
 }