public void RemoveFromRoom(ChatSession session) { if (String.IsNullOrWhiteSpace(session.Room)) { return; } ChatRoom room; if (TryGetValue(session.Room, out room)) { room.Remove(session); if (!room.Any() && TryRemove(session.Room, out room)) { Console.WriteLine("Room " + session.Room + " removed because was empty."); } } }
public ChatMessageHandler(ChatRoomManager chatRoomManager, ChatSession session) { _chatRoomManager = chatRoomManager; _session = session; }