From 5428935270159bfc42c2934ed7fb1091554fc9a4 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 09 七月 2020 17:12:42 +0800 Subject: [PATCH] 修改了 sokect --- ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs | 50 +++++++++++++++++--------------------------------- 1 files changed, 17 insertions(+), 33 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs index 9d9ac37..8f84fd0 100755 --- a/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs +++ b/ZigbeeApp/Shared/Phone/MainPage/HomeMainPageForm.cs @@ -57,7 +57,7 @@ Instance = this; //鍏堝垵濮嬪寲宸︽粦鎴块棿鍒楄〃鐣岄潰(鍦ㄥ弽灏勯噷闈㈠垵濮嬪寲) - if (ListRoomViewFrom.Instance == null) { } + if (LeftListRoomViewFrom.Instance == null) { } //鏁翠釜鑳屾櫙鐨勪笂涓嬫粦鍔ㄦ帶浠� if (this.listBodyContr == null) @@ -90,7 +90,7 @@ private void InitTopFrameLayoutControl() { //澶撮儴瀹瑰櫒 - base.topFrameLayout = new FrameLayout(); + base.topFrameLayout = new NormalFrameLayout(); topFrameLayout.Y = Application.GetRealHeight(60); topFrameLayout.Height = Application.GetRealHeight(127); topFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; @@ -170,7 +170,8 @@ selectHouse.Init(); selectHouse.HouseAction = (houseId) => { - ChangeResidence(HdlResidenceLogic.Current.GetHouseByHouseId(houseId)); + //鍒囨崲浣忓畢 + this.ChangeResidence(HdlResidenceLogic.Current.GetHouseByHouseId(houseId)); }; } }; @@ -255,7 +256,7 @@ } //鍔熻兘鍜屽満鏅痓odyView - this.bodyFrameLayout = new FrameLayout(); + this.bodyFrameLayout = new NormalFrameLayout(); bodyFrameLayout.Y = functionSceneView.Bottom; bodyFrameLayout.Height = this.listBodyContr.frameTable.Height - functionSceneView.Bottom; bodyFrameLayout.BackgroundColor = ZigbeeColor.Current.GXCGrayBackgroundColor; @@ -1055,36 +1056,21 @@ /// <param name="home">Home.</param> private void ChangeResidence(House home) { - try + HdlThreadLogic.Current.RunThread(() => { - CommonPage.Loading.Start(); - new System.Threading.Thread(async () => - { - Config.Instance.HomeId = home.Id; - Config.Instance.Home = HdlResidenceLogic.Current.GetHouseByHouseId(home.Id); - Global.CreateHomeDirectory(home.Id); - Config.Instance.Save(); - //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼ - await UserCenterLogic.InitUserCenterMenmoryAndThread(); + this.ShowProgressBar(); - Application.RunOnMainThread(() => - { - //鍒锋柊鐣岄潰 - this.ShowForm(); + //鍒囨崲浣忓畢 + HdlResidenceLogic.Current.SwitchResidence(home.Id); - CommonPage.Loading.Hide(); - }); - }) - { IsBackground = true }.Start(); - } - catch (Exception ex) - { - Application.RunOnMainThread(() => + HdlThreadLogic.Current.RunMain(() => { - CommonPage.Loading.Hide(); - Console.WriteLine(ex.Message); + //鍒锋柊鐣岄潰 + this.ShowForm(); + + this.CloseProgressBar(); }); - } + }); } #endregion @@ -1151,10 +1137,8 @@ string mainKeys = LocalDevice.Current.GetDeviceMainKeys(report); if (this.dicDeviceCardControl.ContainsKey(mainKeys) == true) { - //鏈湴璁惧瀵硅薄 - var locadevice = LocalDevice.Current.GetDevice(mainKeys); - //鍒锋柊鍗$墖淇℃伅 - this.dicDeviceCardControl[mainKeys].RefreshControlInfo(locadevice); + //寮�鍚崱鐗囬棯鐑佺壒鏁� + this.dicDeviceCardControl[mainKeys].StartCardLightAppeal(); } }, ShowErrorMode.NO); -- Gitblit v1.8.0