From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs | 244 ++++++++++++++++++++++++++++--------------------
1 files changed, 141 insertions(+), 103 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs
old mode 100755
new mode 100644
index b7e2b4e..38f98af
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlThreadLogic.cs
@@ -1,103 +1,141 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter
-{
- /// <summary>
- /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
- /// </summary>
- public class HdlThreadLogic
- {
- #region 鈻� 鍙橀噺澹版槑___________________________
-
- /// <summary>
- /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
- /// </summary>
- private static HdlThreadLogic m_Current = null;
- /// <summary>
- /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
- /// </summary>
- public static HdlThreadLogic Current
- {
- get
- {
- if (m_Current == null)
- {
- m_Current = new HdlThreadLogic();
- }
- return m_Current;
- }
- }
- #endregion
-
- #region 鈻� 绾跨▼鎵ц___________________________
-
- /// <summary>
- /// 瀛愮嚎绋嬫墽琛�(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
- /// </summary>
- public void RunThread(Action action)
- {
- new System.Threading.Thread(() =>
- {
- //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢�
- string nowFormId = UserCenterResourse.NowActionFormID;
- try
- {
- action.Invoke();
- action = null;
- }
- catch (Exception ex)
- {
- Application.RunOnMainThread(() =>
- {
- //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
- 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();
- HdlLogLogic.Current.WriteLog(-1, msg);
- }
- })
- { IsBackground = true }.Start();
- }
-
- /// <summary>
- /// 鎵ц杩愯瀛愮嚎绋嬮噷闈㈢殑涓荤嚎绋�(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
- /// </summary>
- public void RunMainInThread(Action action)
- {
- new System.Threading.Thread(() =>
- {
- 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 + "]\r\n";
- msg += ex.Message + "\r\n";
- msg += ex.TargetSite.ToString();
- HdlLogLogic.Current.WriteLog(-1, msg);
- }
- });
-
- })
- { IsBackground = true }.Start();
- }
-
- #endregion
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ public class HdlThreadLogic
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ private static HdlThreadLogic m_Current = null;
+ /// <summary>
+ /// 绾跨▼閫昏緫(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ public static HdlThreadLogic Current
+ {
+ get
+ {
+ if (m_Current == null)
+ {
+ m_Current = new HdlThreadLogic();
+ }
+ return m_Current;
+ }
+ }
+ #endregion
+
+ #region 鈻� 绾跨▼鎵ц___________________________
+
+ /// <summary>
+ /// 瀛愮嚎绋嬫墽琛�(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ public void RunThread(Action action, ShowErrorMode mode = ShowErrorMode.YES)
+ {
+ new System.Threading.Thread(() =>
+ {
+ //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢�
+ string nowFormId = UserCenterResourse.NowActionFormID;
+ try
+ {
+ action.Invoke();
+ action = null;
+ }
+ catch (Exception ex)
+ {
+ if (mode == ShowErrorMode.YES)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
+ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
+ alert.Show();
+ //鍑虹幇寮傚父,鍒欏叧闂繘搴︽潯
+ ProgressBar.Close();
+ });
+ }
+ //Log鍑哄姏
+ string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]";
+ HdlLogLogic.Current.WriteLog(ex, msg);
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// 鎵ц杩愯瀛愮嚎绋嬮噷闈㈢殑涓荤嚎绋�(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ public void RunMainInThread(Action action, ShowErrorMode mode = ShowErrorMode.YES)
+ {
+ new System.Threading.Thread(() =>
+ {
+ Application.RunOnMainThread(() =>
+ {
+ //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢�
+ string nowFormId = UserCenterResourse.NowActionFormID;
+ try
+ {
+ action.Invoke();
+ action = null;
+ }
+ catch (Exception ex)
+ {
+ if (mode == ShowErrorMode.YES)
+ {
+ //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
+ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
+ alert.Show();
+ }
+ //Log鍑哄姏
+ string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]";
+ HdlLogLogic.Current.WriteLog(ex, msg);
+ //鍑虹幇寮傚父,鍒欏叧闂繘搴︽潯
+ ProgressBar.Close();
+ }
+ });
+
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// 鎵ц杩愯浜庝富绾跨▼(鍒涘缓杩欎釜涓滆タ,鏄负浜哃og鍑哄姏)
+ /// </summary>
+ public void RunMain(Action action, ShowErrorMode mode = ShowErrorMode.YES)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ //璁板綍璧峰綋鍓嶇晫闈紝铏界劧浼间箮娌″暐鐢�
+ string nowFormId = UserCenterResourse.NowActionFormID;
+ try
+ {
+ action.Invoke();
+ action = null;
+ }
+ catch (Exception ex)
+ {
+ if (mode == ShowErrorMode.YES)
+ {
+ //鍑虹幇鏈煡閿欒,鏁版嵁涓㈠け
+ var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnKnownError));
+ alert.Show();
+ }
+
+ //Log鍑哄姏
+ string msg = "褰撳墠婵�娲荤殑鐣岄潰[" + nowFormId + "]";
+ HdlLogLogic.Current.WriteLog(ex, msg);
+ //鍑虹幇寮傚父,鍒欏叧闂繘搴︽潯
+ ProgressBar.Close();
+ }
+ });
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0