From 528c105b3aea0e6e00477365f16f57c1e3d7eb1c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 15:31:28 +0800
Subject: [PATCH] 2019-10-24-3

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs |   45 +++++++++++++++++++--------------------------
 1 files changed, 19 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
index 279e15a..c62be4d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs
@@ -229,7 +229,7 @@
             //鑾峰彇缃戝叧鐨勪俊鎭�
             var result = await zbGateway.GetZbGwInfoAsync();
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
-            string error = UserCenterLogic.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
             if (error != null)
             {
                 if (mode == ShowErrorMode.YES)
@@ -432,7 +432,7 @@
             //鑾峰彇缃戝叧鐨勪俊鎭�
             var result = await zbGateway.GetZbGwInfoAsync();
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
-            string error = UserCenterLogic.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
             if (error != null)
             {
                 this.ShowTipMsg(error);
@@ -503,7 +503,7 @@
 
             var result = await realWay.GwReNameAsync(gatewayName);
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
-            string error = UserCenterLogic.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
             if (error != null)
             {
                 this.ShowErrorMsg(error);
@@ -1112,7 +1112,7 @@
             //鑾峰彇缃戝叧鐗堟湰淇℃伅
             var imageTypeResult = await realWay.GetZbGwInfoAsync();
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
-            string error = UserCenterLogic.CheckCommonErrorCode(imageTypeResult);
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(imageTypeResult);
             if (error != null)
             {
                 if (mode == ShowErrorMode.YES)
@@ -1160,12 +1160,11 @@
         {
             bool bolBreak = false;
             ZbGatewayData.GetGwData result = null;
-            new System.Threading.Thread(async () =>
+            HdlThreadLogic.Current.RunThread(async () =>
             {
                 result = await this.GetGatewayNewInfoAsync(zbGateway, mode);
                 bolBreak = true;
-            })
-            { IsBackground = true }.Start();
+            });
 
             while (bolBreak == false)
             {
@@ -1292,7 +1291,7 @@
             }
             var result = await zbTemp.CheckVDDriveCodeAsync();
             //妫�娴嬬綉鍏宠繑鍥炵殑鍏遍�氶敊璇姸鎬佺爜
-            string error = UserCenterLogic.CheckCommonErrorCode(result);
+            string error = HdlCheckLogic.Current.CheckCommonErrorCode(result);
             if (error != null)
             {
                 this.ShowTipMsg(error);
@@ -1356,7 +1355,7 @@
             if (localWay == null || localWay.getGwInfo == null)
             {
                 //缁欎竴涓嚎绋嬪幓鑾峰彇瀹冪殑闀滃儚绫诲瀷
-                new System.Threading.Thread(async () =>
+                HdlThreadLogic.Current.RunThread(async () =>
                 {
                     var result = await this.GetGatewayNewInfoAsync(zbGateway, ShowErrorMode.NO);
                     if (result != null)
@@ -1369,8 +1368,7 @@
                             }
                         });
                     }
-                })
-                { IsBackground = true }.Start();
+                });
             }
             else
             {
@@ -1390,7 +1388,7 @@
             if (localWay == null || localWay.getGwInfo == null)
             {
                 //缁欎竴涓嚎绋嬪幓鑾峰彇瀹冪殑闀滃儚绫诲瀷
-                new System.Threading.Thread(async () =>
+                HdlThreadLogic.Current.RunThread(async () =>
                 {
                     var result = await this.GetGatewayNewInfoAsync(zbGateway, ShowErrorMode.NO);
                     if (result != null)
@@ -1404,8 +1402,7 @@
                             }
                         });
                     }
-                })
-                { IsBackground = true }.Start();
+                });
             }
             else
             {
@@ -1575,7 +1572,7 @@
                 return;
             }
 
-            new System.Threading.Thread(() =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 var dicStatu = this.GetNowOnlineStatuBeforeCheck();
                 //绛変釜3绉掞紝鍑嗗涓�涓�
@@ -1604,8 +1601,7 @@
                 }
                 //灏嗗彉鍖栫殑缃戝叧鎺ㄩ�佸埌鐣岄潰涓�
                 this.PushGatewayOnlineStatuToForm(dicStatu);
-            })
-            { IsBackground = true }.Start();
+            });
         }
 
         #endregion
@@ -1623,7 +1619,7 @@
                 return;
             }
 
-            new System.Threading.Thread(() =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 //鍏堣幏鍙栫幇鍦ㄥ叏閮ㄧ殑缃戝叧锛屽垵鏈熷�よ缃负涓嶅湪绾�
                 var dicStatu = this.GetNowOnlineStatuBeforeCheck();
@@ -1665,8 +1661,7 @@
                     string msg = Language.StringByID(R.MyInternationalizationString.uRemoteTimeOutAndNotGatewaiOnline);
                     //this.ShowTipMsg(msg);
                 }
-            })
-            { IsBackground = true }.Start();
+            });
         }
 
         #endregion
@@ -1791,7 +1786,7 @@
             }
 
             bool canBreak = false;
-            new System.Threading.Thread(async () =>
+            HdlThreadLogic.Current.RunThread(async () =>
             {
                 List<string> list = new List<string>() { "NotSetAgain" };
 
@@ -1817,8 +1812,7 @@
                 }
                 dicDbGateway = dic;
                 canBreak = true;
-            })
-            { IsBackground = true }.Start();
+            });
 
             int count = 0;
             while (canBreak == false)
@@ -1887,7 +1881,7 @@
         /// </summary>
         public void ResetComandToBindBackupGateway()
         {
-            new System.Threading.Thread(async () =>
+            HdlThreadLogic.Current.RunThread(async () =>
             {
                 var fileData = Global.ReadFileByDirectory(DirNameResourse.LocalMemoryDirectory, DirNameResourse.BackupGatewayIdFile);
                 if (fileData == null)
@@ -1936,8 +1930,7 @@
                     var byteData = System.Text.Encoding.UTF8.GetBytes(strData);
                     Global.WriteFileToDirectoryByBytes(DirNameResourse.LocalMemoryDirectory, DirNameResourse.BackupGatewayIdFile, byteData);
                 }
-            })
-            { IsBackground = true }.Start();
+            });
         }
 
         #endregion

--
Gitblit v1.8.0