From df30e8562e49b45e7a9a3497d368cebd6085be87 Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期一, 30 十二月 2019 17:33:33 +0800 Subject: [PATCH] 2019-12-30-2 --- ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 41 ++++++++++++++++++++++++++++------------- 1 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs index c387b1c..9dbe01c 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs @@ -18,7 +18,6 @@ VerticalRefreshLayout middle; CommonDevice common; Dictionary<string, string> editdeviceConditionsInfo; - public void Show(CommonDevice commondevice, Dictionary<string, string> editdeviceConditions = null) { common = commondevice; @@ -44,6 +43,7 @@ Height = Application.GetRealHeight(69), Y = Application.GetRealHeight(92), TextID = MyInternationalizationString.userlist, + IsBold = true, }; topRowLayout.AddChidren(titleName); @@ -92,6 +92,7 @@ { ///浠庡垪琛ㄧЩ闄ゅ綋鍓嶉棬閿佸叏閮ㄧ殑鏃ф暟鎹紱 Send.LockList.Remove(Send.LockList[i]); + i--; } } Read(); @@ -103,7 +104,7 @@ /// <summary> /// 璇诲彇褰撳墠闂ㄩ攣鐨勪簯绔暟鎹紱 /// </summary> - public async void Read() + public void Read() { bool d = false; @@ -118,14 +119,29 @@ } } + CommonPage.Loading.Start(); - if (!d) - { - var allMemberslist = await Send.AllMembers(common.DeviceAddr); - Send.LockList.AddRange(allMemberslist); - } - UserList(macport); - CommonPage.Loading.Hide(); + 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> /// 鎴愬憳鍒楄〃鐨勬柟娉� @@ -133,7 +149,6 @@ /// <param name="macport"></param> public void UserList(string macport) { - foreach (var user in Send.LockList) { if (user.DoorLockMacPort != macport) @@ -428,9 +443,9 @@ { if (!edit) { - var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt), - Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), - Language.StringByID(MyInternationalizationString.complete)); + var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal, + Language.StringByID(MyInternationalizationString.selectdevicestatuscondition), + Language.StringByID(MyInternationalizationString.confrim)); alert.Show(); return; } -- Gitblit v1.8.0