Exemplo n.º 1
0
 public virtual void OnSwitchStateChanged(SwitchStateChangedEventArgs e)
 {
     if (SwitchStateChanged != null)
     {
         SwitchStateChanged(this, e);
         SetSwitch((Int16)(e.switchNumber), e.state);
     }
 }
Exemplo n.º 2
0
        private void SwitchStateChanged(object sender, SwitchStateChangedEventArgs e)
        {
            switch (e.switchNumber)
            {
            case 1:
                checkBox1.InvokeIfRequired(checkBox1 => { checkBox1.Checked = e.state; });
                break;

            case 2:
                checkBox2.InvokeIfRequired(checkBox2 => { checkBox2.Checked = e.state; });
                break;

            case 3:
                checkBox3.InvokeIfRequired(checkBox3 => { checkBox3.Checked = e.state; });
                break;

            case 4:
                checkBox4.InvokeIfRequired(checkBox4 => { checkBox4.Checked = e.state; });
                break;
            }
            eqSwitch.SetSwitch((Int16)e.switchNumber, e.state);
        }