private void NormalStoppage(Boolean set) { Action setter = () => { if (set) { button4.BackColor = Color.Red; pictureBox_Click(null, null); QTtool.playWavAudio(Properties.Resources.ALARM3); } else { button4.BackColor = System.Drawing.SystemColors.ControlLight; } }; if (button4.BackColor == Color.Red && !set || button4.BackColor != Color.Red && set) { if (button4.InvokeRequired) { button4.Invoke(setter); } else { setter(); } } }
public static void OnBroadCallListener(BroadCallInfo mycall) { elevatorinfo el = ht[mycall.ip] as elevatorinfo; if (el == null) { return; } if (mycall.e_num == 3) { boardIP = mycall.ip; el.pictureBox_Click(null, null); //el.playAlerm(); QTtool.playWavAudio(Properties.Resources.ALARM3); Log.log(el.lbpostion.Text + "呼叫" + " " + " " + el.lbnum.Text + " " + "电梯IP " + el.MMC_ip); } else if (mycall.ip == boardIP && mycall.e_num == 1) { TestForm.instantsClose(); } }