HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
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, () =>
                    {
                        //记录起选择的ID
                        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;