예제 #1
0
        private void dutPhoneStateChanged(object sender, DutPhoneStateChangedEventArgs param1)
        {
            if (this.InvokeRequired)
            {
                delGenernal del = new delGenernal(dutPhoneStateChanged);
                this.Invoke(del, sender, param1);
            }
            else
            {
                dutController dut = sender as dutController;
                DutPhoneStateChangedEventArgs pscea = param1 as DutPhoneStateChangedEventArgs;
                TextBox txtBox;
                if (dut.Equals(dut1))
                {
                    txtBox = txtDut1PhoneState;
                }
                else
                {
                    txtBox = txtDut2PhoneState;
                }
                txtBox.Text      = pscea.State.ToString();
                txtBox.ForeColor = System.Drawing.Color.White;
                switch (pscea.State)
                {
                case dutController.DutPhoneState.Idle:
                    txtBox.BackColor = System.Drawing.Color.LimeGreen;
                    break;

                case dutController.DutPhoneState.Rejected:
                    txtBox.BackColor = System.Drawing.Color.Purple;
                    break;

                case dutController.DutPhoneState.Answered:
                case dutController.DutPhoneState.Connected:
                    txtBox.BackColor = System.Drawing.Color.Crimson;
                    break;

                case dutController.DutPhoneState.Dialing:
                    txtBox.BackColor = System.Drawing.Color.Orange;
                    break;

                case dutController.DutPhoneState.EndCall:
                    txtBox.BackColor = System.Drawing.Color.Green;
                    break;

                case dutController.DutPhoneState.Offhook:
                    txtBox.BackColor = System.Drawing.Color.Red;
                    break;

                case dutController.DutPhoneState.Ringing:
                    txtBox.BackColor = System.Drawing.Color.OrangeRed;
                    break;

                case dutController.DutPhoneState.Unknow:
                default:
                    txtBox.BackColor = System.Drawing.Color.DarkGray;
                    break;
                }
            }
        }
예제 #2
0
 private void DutPhoneStateChangedEventHandler(object sender, DutPhoneStateChangedEventArgs ea)
 {
     refreshDutPhoneState(ea.State);
 }
예제 #3
0
 private void dutPhoneStateChangedEventHandler(object sender, DutPhoneStateChangedEventArgs pscea)
 {
     dutPhoneStateChanged(sender, pscea);
 }
예제 #4
0
 private void dutPhoneStateChanged(object sender, DutPhoneStateChangedEventArgs dscea)
 {
     //_dut1.CurrentPhoneState
 }