| | |
| | | private void InitTopRightMenuControl()
|
| | | {
|
| | | //获取楼层
|
| | | var dicFloor = Common.Room.CurrentRoom.GetFloorSortList();
|
| | | var dicFloor = HdlRoomLogic.Current.GetFloorSortList();
|
| | | if (dicFloor.Count == 0)
|
| | | {
|
| | | return;
|
| | |
| | | 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;
|
| | |
| | | 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>();
|
| | |
| | | int fileCount = this.GetUpLoadRoomData(listRoom, dicDevice, dicScene);
|
| | |
|
| | | var listCheckFile = new HashSet<string>();
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
| | | 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;
|
| | |
| | | this.CloseProgressBar();
|
| | |
|
| | | //不管成功还是失败,都刷新界面
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (this.Parent != null)
|
| | | {
|
| | |
| | | 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)
|
| | | {
|
| | | //异常
|
| | |
| | | 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)
|
| | | {
|
| | | //异常,或者已经分享了的,不再显示
|
| | |
| | | /// <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;
|
| | | }
|
| | |
| | | //没有这个房间
|
| | | 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;
|