Пример #1
0
        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.");
                }
            }
        }
Пример #2
0
 public ChatMessageHandler(ChatRoomManager chatRoomManager, ChatSession session)
 {
     _chatRoomManager = chatRoomManager;
     _session         = session;
 }