| | |
| | | /// <summary>
|
| | | /// 桌布控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | | private NormalFrameLayout frameTable = null;
|
| | | /// <summary>
|
| | | /// 房间对象
|
| | | /// </summary>
|
| | |
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //桌布控件
|
| | | this.frameTable = new FrameLayout();
|
| | | this.frameTable = new NormalFrameLayout();
|
| | | frameTable.Y = frameBack.Bottom;
|
| | | frameTable.Height = bodyFrameLayout.Height - frameBack.Height;
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | |
| | | }
|
| | | //这个手机弄弄,那个手机弄弄的情况下,
|
| | | //采用后备操作 -> 新建一个临时房间对象出来
|
| | | if (Common.Room.CurrentRoom.GetRoomByDevice(device) == null)
|
| | | if (HdlRoomLogic.Current.GetRoomByDevice(device) == null)
|
| | | {
|
| | | tempRoom.DeviceUIList.Add(Common.LocalDevice.Current.GetDeviceUI(device));
|
| | | tempRoom.ListDevice.Add(Common.LocalDevice.Current.GetDeviceMainKeys(device));
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | //初始化房间控件
|
| | | var listRoom = new List<Common.Room>();
|
| | | listRoom.AddRange(dicRoom[nowSelectFloorId]);
|
| | | if (tempRoom.DeviceUIList.Count > 0)
|
| | | if (tempRoom.ListDevice.Count > 0)
|
| | | {
|
| | | //显示新建的临时房间对象
|
| | | listRoom.Add(tempRoom);
|
| | |
| | | //界面关闭
|
| | | this.CloseForm();
|
| | | };
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnOk.CanClick = false;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | private void InitTopRightMenuControl()
|
| | | {
|
| | | //房间分组
|
| | | foreach (var room in Common.Room.Lists)
|
| | | var listRoom = HdlRoomLogic.Current.GetAllListRooms();
|
| | | foreach (var room in listRoom)
|
| | | {
|
| | | //检测该房间能否显示
|
| | | if (this.CheckCanShowRow(room) == false)
|
| | |
| | | }
|
| | |
|
| | | //获取楼层
|
| | | 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 TopRightMenuControl(dicFloor.Count, 2, Language.StringByID(R.MyInternationalizationString.SelectFloor));
|
| | | foreach (var floorId in dicFloor.Keys)
|
| | | {
|
| | | contr.AddRowMenu(dicFloor[floorId], "Floor/Floor.png", "Floor/FloorSelected.png", () =>
|
| | |
| | | frameTable.AddChidren(listView);
|
| | |
|
| | | var listDevice = new List<ZigBee.Device.CommonDevice>();
|
| | | foreach (var deviceUi in room.DeviceUIList)
|
| | | foreach (var deviceKeys in room.ListDevice)
|
| | | {
|
| | | var device = deviceUi.CommonDevice;
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | //检测设备
|
| | | if (this.CheckCanShowDevice(device) == true)
|
| | | {
|
| | |
| | | listEsixtDevice.Remove(mainKey);
|
| | | }
|
| | | };
|
| | | //查看模板时,不允许编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | rowDevice.CanClick = false;
|
| | | }
|
| | | }
|
| | | listDevice = null;
|
| | | //调整控件真实高度
|
| | |
| | | /// <returns></returns>
|
| | | private bool CheckCanShowRow(Common.Room room)
|
| | | {
|
| | | if (room.DeviceUIList.Count == 0)
|
| | | if (room.ListDevice.Count == 0)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | {
|
| | | return false;
|
| | | }
|
| | | foreach (var deviceUi in room.DeviceUIList)
|
| | | foreach (var deviceKeys in room.ListDevice)
|
| | | {
|
| | | //检测该设备能否显示
|
| | | if (this.CheckCanShowDevice(deviceUi.CommonDevice) == false)
|
| | | var device = Common.LocalDevice.Current.GetDevice(deviceKeys);
|
| | | if (this.CheckCanShowDevice(device) == false)
|
| | | {
|
| | | continue;
|
| | | }
|