From 94e4e5b9fd3da964c44b7b14227d6fe2bbb426d7 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 02 四月 2020 13:56:39 +0800
Subject: [PATCH] 2020-04-02-2

---
 ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs |   57 +++++++++++++++++++++++++--------------------------------
 1 files changed, 25 insertions(+), 32 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
index bcfc50f..a20b2b5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Residence/ResidenceListForm.cs
@@ -117,11 +117,20 @@
                     listResidenceSort.Add(pageData.PageData[i].Id);
                 }
             }
+            for (int i = 0; i < listResidenceSort.Count; i++)
+            {
+                //绉婚櫎鎺変笉瀛樺湪浜嗙殑椤哄簭
+                if (dicData.ContainsKey(listResidenceSort[i]) == false)
+                {
+                    listResidenceSort.RemoveAt(i);
+                    i--;
+                }
+            }
             //淇濆瓨椤哄簭
             string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.ResidenceSortFile);
             UserCenterLogic.SaveFileContent(fullName, listResidenceSort);
 
-            Application.RunOnMainThread(() =>
+            HdlThreadLogic.Current.RunMain(() =>
             {
                 if (this.Parent == null)
                 {
@@ -132,6 +141,10 @@
                 this.dicResidenceData = new Dictionary<string, Common.ResponseEntity.ResidenceObj>();
                 for (int i = 0; i < listResidenceSort.Count; i++)
                 {
+                    if (dicData.ContainsKey(listResidenceSort[i]) == false)
+                    {
+                        continue;
+                    }
                     var info = dicData[listResidenceSort[i]];
                     if (info.IsOthreShare == false)
                     {
@@ -206,16 +219,19 @@
                     {
                         HdlThreadLogic.Current.RunThread(async () =>
                         {
-                            ProgressBar.Show();
+                            this.ShowProgressBar();
+
                             Config.Instance.HomeId = info.Id;
                             Global.CreateHomeDirectory(info.Id);
+                            //閲嶆柊鍒濆鍖栦綇瀹呭璞�
+                            Config.Instance.Home = House.GetHouseByHouseId(info.Id);
                             Config.Instance.Save();
                             //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
-                            await UserCenterLogic.InitUserCenterMenmoryAndThread();
+                            await UserCenterLogic.InitUserCenterMenmoryAndThread(false);
 
-                            Room.InitAllRoom();
+                            HdlRoomLogic.Current.InitAllRoom();
 
-                            Application.RunOnMainThread(() =>
+                            HdlThreadLogic.Current.RunMain(() =>
                             {
                                 //閲嶆柊鍒锋柊鍒楄〃
                                 this.listView.RemoveAll();
@@ -264,7 +280,7 @@
         private void ShowEditorNameForm(Common.ResponseEntity.ResidenceObj info, NormalViewControl btnHome)
         {
             //鐢熸垚涓�涓脊绐楃敾闈�
-            var dialogForm = new DialogInputFrameControl(this, DialogFrameMode.OnlyInput);
+            var dialogForm = new DialogInputControl();
             //缂栬緫浣忓畢
             dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uChangedName));
             //璇疯緭鍏ヤ綇瀹呭悕绉�
@@ -340,7 +356,7 @@
         private void ShowAddNameForm()
         {
             //鐢熸垚涓�涓脊绐楃敾闈�
-            var dialogForm = new DialogInputFrameControl(this, DialogFrameMode.OnlyInput);
+            var dialogForm = new DialogInputControl();
             //鍒涘缓浣忓畢
             dialogForm.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCreatResidence));
             //璇疯緭鍏ヤ綇瀹呭悕绉�
@@ -464,7 +480,7 @@
                 {
                     //淇濆瓨椤哄簭
                     listResidenceSort.Remove(keys);
-                    Room.CurrentRoom.SaveFloorSort(listResidenceSort);
+                    HdlRoomLogic.Current.SaveFloorSort(listResidenceSort);
 
                     this.listView.RemoveAll();
                     //鏁版嵁宸茬粡鍙樻洿
@@ -513,7 +529,7 @@
             public PageSettingInfo PageSetting = new PageSettingInfo()
             {
                 Page = 1,
-                PageSize = 500
+                PageSize = 5000
             };
         }
 
@@ -545,29 +561,6 @@
             /// ZigbeeHomeGuid
             /// </summary>
             public string Id = string.Empty;
-        }
-
-        /// <summary>
-        ///  缂栬緫浣忓畢鐨勫惎鍔ㄥ弬鏁�
-        /// </summary>
-        public class EditorResidencePra : IfacePraCommon
-        {
-            /// <summary>
-            /// RequestVersion
-            /// </summary>
-            public string RequestVersion = Common.CommonPage.RequestVersion;
-            /// <summary>
-            /// LoginAccessToken
-            /// </summary>
-            public string LoginAccessToken = Common.Config.Instance.Token;
-            /// <summary>
-            /// ZigbeeHomeId
-            /// </summary>
-            public string HomeId = "";
-            /// <summary>
-            /// Name
-            /// </summary>
-            public string Name = string.Empty;
         }
 
         #endregion

--
Gitblit v1.8.0