From a4924de3136289d10cabbf2f61a228387d44ded7 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 07 十一月 2019 13:48:36 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs | 39 ++++++++++++++++----------------------- 1 files changed, 16 insertions(+), 23 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs index 30dbd10..a6f4487 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlGatewayLogic.cs @@ -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) { @@ -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 @@ -2000,7 +1993,7 @@ var listSaveFile = new HashSet<string>(); foreach (string fileName in listBackFile) { - if (fileName.Length < 10 || fileName.StartsWith(Common.LocalDevice.deviceFirstName) == false) + if (fileName.Length < 10 || fileName.StartsWith("Device_") == false) { //涓嶆槸璁惧澶囦唤鏂囦欢 continue; @@ -2060,7 +2053,7 @@ if (deleteFile.Length > 12) { string deviceFileName = deleteFile.Substring(5); - if (deviceFileName.StartsWith(Common.LocalDevice.deviceFirstName) == false) + if (deviceFileName.StartsWith("Device_") == false) { //涓嶆槸璁惧鏂囦欢 continue; -- Gitblit v1.8.0