| | |
| | | |
| | | public FrameLayout itemView; |
| | | |
| | | static RoomManagement roomManagement; |
| | | public static RoomManagement Instance |
| | | { |
| | | get |
| | | { |
| | | if (roomManagement == null) |
| | | { |
| | | roomManagement = new RoomManagement { }; |
| | | } |
| | | return roomManagement; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 是否可以触发点击事件--是否可以跳转主页房间 |
| | | /// </summary> |
| | | public bool CanClick = true; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | public Action action; |
| | | |
| | | |
| | | |
| | | public override void RemoveFromParent() |
| | | { |
| | |
| | | /// </summary> |
| | | public void Show() |
| | | { |
| | | RemoveAll(); |
| | | |
| | | AddTop(); |
| | | |
| | | AddBodyView(Config.Instance.Home.CurrentFloorId); |
| | |
| | | var room = roomList[i]; |
| | | var roomView = new RoomMainView(xx, yy); |
| | | itemView.AddChidren(roomView); |
| | | roomView.Init(); |
| | | roomView.Init(this,room); |
| | | roomView.SetRoomName(room.Name); |
| | | roomView.SetRoomIcon(room.BackgroundImage); |
| | | roomView.SetRoomIcon(room.BackgroundImageType == 0 ? room.BackgroundImage : System.IO.Path.Combine(Config.Instance.FullPath, room.BackgroundImage)); |
| | | roomView.ClickBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | if (CanClick == false) |
| | | { |
| | | return; |
| | | } |
| | | CommonPage.Instance.CloseLeftMenu(); |
| | | Common.Room.CurrentRoom = room; |
| | | Config.Instance.Home.CurrentFloorId = room.FloorId; |
| | | UserPage.Instance.Fresh(); |
| | | }; |
| | | } |
| | | else |
| | | { |
| | |
| | | /// <summary> |
| | | /// 房间管理界面 |
| | | /// </summary> |
| | | void RoomPage() |
| | | public RoomManagement() |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | roomManagement = this; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void ShowUnallocatedRoom_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | if(CanClick==false) |
| | | { |
| | | return; |
| | | } |
| | | var unalloctedRoom = new UnallocatedRoom(); |
| | | AddChidren(unalloctedRoom); |
| | | unalloctedRoom.Show(); |