コード例 #1
0
        /// <summary>
        /// delete a room from the rooms repository.
        /// </summary>
        /// <param name="roomName">the name of the room to be deleted</param>
        public static void DeleteRoom(string roomName)
        {
            Room existingRoom = new Room() { RoomName = roomName };

            ICollection<User> usersOfRoom = GetUsersOfRoom(roomName);
            foreach (User user in usersOfRoom)
            {
                RemoveUserFromRoom(roomName, user);
                // TODO: users need to be kicked from the rooms they are in...
            }

            rooms.Delete(existingRoom);
        }
コード例 #2
0
 /// <summary>
 /// adds a new room to the rooms repository.
 /// </summary>
 /// <param name="roomName">the name of the room to be added</param>
 public static void AddRoom(string roomName)
 {
     Room newRoom = new Room() { RoomName = roomName };
     rooms.Create(newRoom);
 }