天天看點

背景線程下的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://www.cnblogs.com/woxpp

本文版權歸作者和部落格園共有,歡迎轉載,但未經作者同意必須保留此段聲明,且在文章頁面明顯位置給出原文連接配接。

生活不易,五行缺金,求打點

背景線程下的WinFrom窗體控件操作 Invoke