From f1c3921b08bb22ac6f5db22d620e01d7e8e5c49f Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 13:32:33 +0800 Subject: [PATCH] 2019-12-30-1 --- ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 39 +++++++++++++++++++++++---------------- 1 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs index de49765..a322a5f 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs @@ -119,21 +119,29 @@ } } - if (!d) - { - CommonPage.Loading.Start(); - new System.Threading.Thread(async () => - { - var allMemberslist = await Send.AllMembers(macport); - Send.LockList.AddRange(allMemberslist); - Application.RunOnMainThread(() => - { - CommonPage.Loading.Hide(); - }); - }) - { IsBackground = true }.Start(); - } - UserList(macport); + + CommonPage.Loading.Start(); + middle.RemoveAll(); + System.Threading.Tasks.Task.Run(async () => + { + try + { + if (!d) + { + var allMemberslist = await Send.AllMembers(macport); + Send.LockList.AddRange(allMemberslist); + } + } + catch { } + finally + { + Application.RunOnMainThread(() => + { + CommonPage.Loading.Hide(); + UserList(macport); + }); + } + }); } /// <summary> /// 鎴愬憳鍒楄〃鐨勬柟娉� @@ -141,7 +149,6 @@ /// <param name="macport"></param> public void UserList(string macport) { - middle.RemoveAll(); foreach (var user in Send.LockList) { if (user.DoorLockMacPort != macport) -- Gitblit v1.8.0