From 2b80706e6c760bf59212ff53f8c58f4fc68b99af Mon Sep 17 00:00:00 2001 From: WJC <wjc@hdlchina.com.cn> Date: 星期四, 31 十月 2019 15:35:23 +0800 Subject: [PATCH] 2019-10-31-3 --- ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs index 39fe971..4d7983c 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs @@ -15,7 +15,7 @@ Dictionary<string, string> deviceConditionsInfo = new Dictionary<string, string>(); Dictionary<string, string> userdictionary = new Dictionary<string, string>(); - public void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo=null) + public async void Show(CommonDevice common, Dictionary<string, string> editdeviceConditionsInfo=null) { if (!edit) { @@ -88,7 +88,11 @@ BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, }; this.AddChidren(middle); - + if (Send.UserList.Count == 0) + { + var allMemberslist = await Send.AllMembers(common.DeviceAddr); + Send.UserList.AddRange(allMemberslist); + } foreach (var user in Send.UserList) { @@ -211,7 +215,7 @@ lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * user.UserIdMode.Count) + 20 + 50); for (int i = 0; i < user.UserIdMode.Count; i++) { - var userid = user.UserIdMode[i]; + var userifon = user.UserIdMode[i]; var doorlockfra = new FrameLayout { Height = Application.GetRealHeight(160), @@ -237,8 +241,7 @@ }; doorlockRow.AddChidren(doorlockBtn); //(1鎸夐敭/3鍗�/15鎸囩汗) - string[] s = userid.Split('_'); - switch (s[1]) + switch (userifon.OpenMode.ToString()) { case "0": { @@ -286,8 +289,8 @@ { deviceConditionsInfo.Remove("AttriButeData2"); } - deviceConditionsInfo.Add("AttriButeId", s[1]); - deviceConditionsInfo.Add("AttriButeData2", s[0]); + deviceConditionsInfo.Add("AttriButeId", userifon.OpenMode.ToString()); + deviceConditionsInfo.Add("AttriButeData2", userifon.UserId); if (userdictionary.ContainsKey("Account")) { @@ -303,7 +306,7 @@ } userdictionary.Add("Account", Btntitle.Text+doorlockBtn.Text); userdictionary.Add("Type", "1"); - userdictionary.Add("UserId", s[0]); + userdictionary.Add("UserId", userifon.UserId); }; doorlockRow.MouseUpEventHandler += doorlockclick; doorlockBtn.MouseUpEventHandler += doorlockclick; @@ -311,7 +314,7 @@ doorlockfra.MouseUpEventHandler += doorlockclick; if (edit) { - if (editdeviceConditionsInfo["AttriButeData2"] == s[1]) + if (editdeviceConditionsInfo["AttriButeData2"] == userifon.OpenMode.ToString()) { selectedIcon.Visible = false; selectedIcon = doorlockSelected; @@ -385,5 +388,6 @@ } } + } } -- Gitblit v1.8.0