public static CtrlMsg GetInstance() { // 如果类的实例不存在则创建,否则直接返回 if (_ctrlMsg == null) { _ctrlMsg = new CtrlMsg(); } return(_ctrlMsg); }
private void checkBoxOut15_CheckedChanged(object sender, EventArgs e) { if (checkBoxOut15.Checked) { SendMessage(CtrlMsg.GetInstance().Out15On); WriteToIOSendText(CtrlMsg.GetInstance().Out15On); } else { SendMessage(CtrlMsg.GetInstance().Out15Off); WriteToIOSendText(CtrlMsg.GetInstance().Out15Off); } }
private void buttonStay_Click(object sender, EventArgs e) { SendMessage(CtrlMsg.GetInstance().Stay); WriteToIOSendText(CtrlMsg.GetInstance().Stay); }