后台线程下的WinFrom窗体控件操作 Invoke
Invoke(new MethodInvoker(delegate { ControllerLogout(controller_id, is_successful, description, controller); }));
/// <summary> /// 控制器退出 /// </summary> private void ControllerLogout(int controller_id, bool is_successful, string description, EbtController controller) { if (is_successful) { if (plChannel.Controls == null) return; foreach (Control control in plChannel.Controls) { EbtControl ebtcontrol = control as EbtControl; if (ebtcontrol != null && ebtcontrol.ChannelInfo.PhoneConfiguration.DataID == controller_id) { ebtcontrol.Enabled = false; ebtcontrol.Controller = null; } } AddLogRecord(new LogRecord(DateTime.Now, LogGrade.信息, LogType.外围系统, "电话控制器", description)); } else { AddLogRecord(new LogRecord(DateTime.Now, LogGrade.警告, LogType.外围系统, "电话控制器", description)); } }
生活不易,五行缺金,求打点
![](http://files.cnblogs.com/files/woxpp/QQ%E6%88%AA%E5%9B%BE20161229110254.bmp)