From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs |   54 +++++++++++++++++++++---------------------------------
 1 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
index de98c4b..6f0377a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/SharedContent/AddNewSharedListRoomForm.cs
@@ -117,7 +117,7 @@
         private void InitTopRightMenuControl()
         {
             //鑾峰彇妤煎眰
-            var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
+            var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
             if (dicFloor.Count == 0)
             {
                 return;
@@ -144,10 +144,10 @@
             btnIconContr.ButtonClickEvent += (sender, e) =>
             {
                 //妤煎眰鑿滃崟
-                var contr = new TopRightMenuControl(dicFloor.Count, 449, Language.StringByID(R.MyInternationalizationString.SelectFloor));
+                var contr = new TopRightFloorMenuControl(dicFloor.Count, 2, this.nowSelectFloorId, Language.StringByID(R.MyInternationalizationString.SelectFloor));
                 foreach (var floorId in dicFloor.Keys)
                 {
-                    contr.AddRowMenu(dicFloor[floorId], "Floor/Floor.png", "Floor/FloorSelected.png", () =>
+                    contr.AddRowMenu(floorId, () =>
                     {
                         //璁板綍璧烽�夋嫨鐨処D
                         this.nowSelectFloorId = floorId;
@@ -170,7 +170,7 @@
         private void InitAreaListRow(string floorId)
         {
             dicSelectRoom.Clear();
-            var listRoom = Common.Room.CurrentRoom.GetFloorSortRoom(floorId, false);
+            var listRoom = HdlRoomLogic.Current.GetFloorSortRoom(floorId, false);
             HdlThreadLogic.Current.RunMain(() =>
             {
                 var listDataRoom = new List<Common.Room>();
@@ -199,26 +199,12 @@
                     frameTemp.Height = bodyFrameLayout.Height - btnShard.Y;
                     listView.AddChidren(frameTemp);
                 }
-                if (listView.ChildrenCount == 0)
+                if (listDataRoom.Count == 0)
                 {
                     //濡傛灉娌℃湁鑳藉鍏变韩鐨勬埧闂�
                     bodyFrameLayout.RemoveAll();
-
-                    //鍥剧墖
-                    var btnPic = new PicViewControl(383, 279);
-                    btnPic.Gravity = Gravity.CenterHorizontal;
-                    btnPic.Y = Application.GetRealHeight(498);
-                    btnPic.UnSelectedImagePath = "Item/NotShardPic.png";
-                    bodyFrameLayout.AddChidren(btnPic);
-
                     //鏃犲彲鍏变韩鐨勬埧闂�
-                    var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false);
-                    btnMsg1.Y = Application.GetRealHeight(962);
-                    btnMsg1.TextAlignment = TextAlignment.Center;
-                    btnMsg1.TextSize = 12;
-                    btnMsg1.TextColor = UserCenterColor.Current.TextGrayColor1;
-                    btnMsg1.TextID = R.MyInternationalizationString.uNotShardDeviceInAllRoomMsg;
-                    bodyFrameLayout.AddChidren(btnMsg1);
+                    this.ShowNotDataImage(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uNotCanShardRoomMsg), "Item/NotShardPic.png", 383, 279);
                 }
             });
         }
@@ -235,7 +221,7 @@
             listView.AddChidren(row);
             //鍥炬爣
             var btnIcon = row.AddLeftIcon(81);
-            btnIcon.UnSelectedImagePath = "Item/RoomIcon.png";
+            btnIcon.UnSelectedImagePath = "Item/RoomIconSelected.png";
             //鎴块棿鍚�
             var btnName = row.AddLeftCaption(room.Name, 650);
             btnName.TextSize = 15;
@@ -249,7 +235,6 @@
                 var form = new AddNewSharedContentForm();
                 form.AddForm(room, memberShardInfo);
             };
-
 
             //閫夋嫨
             var btnSelect = row.AddMostRightEmptyIcon(69, 69);
@@ -297,7 +282,7 @@
             int fileCount = this.GetUpLoadRoomData(listRoom, dicDevice, dicScene);
 
             var listCheckFile = new HashSet<string>();
-            HdlThreadLogic.Current.RunThread(async () =>
+            HdlThreadLogic.Current.RunThread(() =>
             {
                 //鎵撳紑杩涘害鏉�
                 this.ShowProgressBar();
@@ -305,7 +290,7 @@
                 for (int index = 0; index < listRoom.Count; index++)
                 {
                     //鎵ц涓婁紶
-                    var result = await HdlShardLogic.Current.DoUploadSharedContent(memberShardInfo, listRoom[index], dicDevice[index], dicScene[index], fileCount, listCheckFile);
+                    var result = HdlShardLogic.Current.DoUploadSharedContent(memberShardInfo, listRoom[index], dicDevice[index], dicScene[index], fileCount, listCheckFile);
                     if (result == false)
                     {
                         break;
@@ -315,7 +300,7 @@
                 this.CloseProgressBar();
 
                 //涓嶇鎴愬姛杩樻槸澶辫触,閮藉埛鏂扮晫闈�
-                Application.RunOnMainThread(() =>
+                HdlThreadLogic.Current.RunMain(() =>
                 {
                     if (this.Parent != null)
                     {
@@ -346,9 +331,9 @@
                 dicScene[i] = listScene;
 
                 //鑾峰彇鎴块棿鍏ㄩ儴璁惧
-                foreach (var deviceUi in listRoom[i].DeviceUIList)
+                foreach (var deviceKeys in listRoom[i].ListDevice)
                 {
-                    var device = deviceUi.CommonDevice;
+                    var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
                     if (device == null || memberShardInfo.dicAllShardKeys.ContainsKey(device.FilePath) == true)
                     {
                         //寮傚父
@@ -371,8 +356,9 @@
                 var listChirdDevice = new List<CommonDevice>();
                 var listChirdScene = new List<Common.SceneUI>();
                 //鑾峰彇鎴块棿鍏ㄩ儴鍦烘櫙
-                foreach (var sceneUi in listRoom[i].SceneUIList)
+                foreach (var sceneId in listRoom[i].ListSceneId)
                 {
+                    var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
                     if (sceneUi == null || memberShardInfo.dicAllShardKeys.ContainsKey(sceneUi.FileName) == true)
                     {
                         //寮傚父锛屾垨鑰呭凡缁忓垎浜簡鐨勶紝涓嶅啀鏄剧ず
@@ -439,7 +425,7 @@
         /// <returns></returns>
         private bool CheckCanShowRow(Common.Room room)
         {
-            if (room.DeviceUIList.Count == 0 && room.SceneUIList.Count == 0)
+            if (room.ListDevice.Count == 0 && room.ListSceneId.Count == 0)
             {
                 return false;
             }
@@ -452,20 +438,22 @@
                 //娌℃湁杩欎釜鎴块棿
                 return true;
             }
-            foreach (var deviceUi in room.DeviceUIList)
+            foreach (var deviceKeys in room.ListDevice)
             {
-                if (deviceUi.CommonDevice == null)
+                var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
+                if (device == null)
                 {
                     continue;
                 }
-                if (memberShardInfo.dicAllShardKeys.ContainsKey(deviceUi.CommonDevice.FilePath) == false)
+                if (memberShardInfo.dicAllShardKeys.ContainsKey(device.FilePath) == false)
                 {
                     //瀛樺湪鏈垎浜殑璁惧鐨勮瘽锛屾鎴块棿鍙互鏄剧ず
                     return true;
                 }
             }
-            foreach (var sceneUi in room.SceneUIList)
+            foreach (var sceneId in room.ListSceneId)
             {
+                var sceneUi = HdlSceneLogic.Current.GetSceneUIBySceneId(sceneId);
                 if (sceneUi == null)
                 {
                     continue;

--
Gitblit v1.8.0