Пример #1
0
        internal void CloseRoomView(ViewRoom view, bool deselect = false)
        {
            _roomViews.Remove(view);

            if (deselect)
            {
                foreach (ListViewItem item in RoomList.Items)
                {
                    if (((Client.Room)item.Tag).ID == view.Room.ID)
                    {
                        item.Selected = false;

                        break;
                    }
                }
            }
        }
Пример #2
0
        private ViewRoom ShowRoom(Room room)
        {
            ViewRoom view = null;

            if (room != null)
            {
                // first, check to see if it's already open
                view = _roomViews.FirstOrDefault(r => r.Room.ID == room.ID);

                // if it isn't, open it up
                if (view == null)
                {
                    view = new ViewRoom()
                    {
                        Room = room, Player = _player
                    };
                    _roomViews.Add(view);
                    view.Show(this);
                }
            }

            return(view);
        }