From c6b35c3138b944830b5336bf610f918154dd47c7 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期六, 12 十月 2019 15:45:10 +0800 Subject: [PATCH] 合并门锁,完成住宅管理 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs | 38 ++++++++++++++++++++++++++++++++------ 1 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs index b7e2b4e..267595d 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs @@ -56,10 +56,9 @@ alert.Show(); }); //Log鍑哄姏 - string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]\r\n"; - msg += ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } }) { IsBackground = true }.Start(); @@ -87,10 +86,9 @@ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); alert.Show(); //Log鍑哄姏 - string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]\r\n"; - msg += ex.Message + "\r\n"; - msg += ex.TargetSite.ToString(); + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); } }); @@ -98,6 +96,34 @@ { IsBackground = true }.Start(); } + /// <summary> + /// 鎵ц杩愯浜庝富绾跨▼(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏) + /// </summary> + public void RunMain(Action action) + { + Application.RunOnMainThread(() => + { + //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢� + string nowFormId = UserCenterResourse.NowActionFormID; + try + { + action.Invoke(); + action = null; + } + catch (Exception ex) + { + //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け + var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost)); + alert.Show(); + + //Log鍑哄姏 + string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]"; + HdlLogLogic.Current.WriteLog(-1, msg); + HdlLogLogic.Current.WriteLog(ex); + } + }); + } + #endregion } } -- Gitblit v1.8.0