HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-04 c7698e163e43cea9e7f8ee45f8e3f91c9265cca4
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlDeviceAttributeLogic.cs
@@ -145,14 +145,24 @@
                    //命令区分一致时,则调用回调函数
                    list.Add(this.dicEvent[keys]);
                }
                HdlThreadLogic.Current.RunMain(() =>
                //有可能在回调函数中移除了事件,导致报错,所以先收集,再调用
                Application.RunOnMainThread(() =>
                {
                    //有可能在回调函数中移除了事件,导致报错,所以先收集,再调用
                    foreach (var action in list)
                    {
                        action?.Invoke(common);
                        try
                        {
                            action?.Invoke(common);
                        }
                        catch (Exception ex)
                        {
                            //Log出力
                            string msg = "当前激活的界面[" + UserCenterResourse.NowActionFormID + "]";
                            HdlLogLogic.Current.WriteLog(-1, msg);
                            HdlLogLogic.Current.WriteLog(ex);
                        }
                    }
                    list.Clear();
                });
            }
        }