예제 #1
0
        public void RemoveActor(Actor actor)
        {
            string id = string.Format("{0}_{1}", actor.ActorId, actor.ActorName);

            if (ChatRoom.ContainsKey(id))
            {
                ChatRoom.Remove(id);
            }
        }
예제 #2
0
        private void RemoveActor(ChatMessage msg)
        {
            string id = string.Format("{0}_{1}", msg.ChatActor.ActorId, msg.ChatActor.ActorName);

            if (ChatRoom.ContainsKey(id))
            {
                ChatRoom.Remove(id);
            }
        }
예제 #3
0
        public void AddActor(Actor a)
        {
            string id = string.Format("{0}_{1}", a.ActorId, a.ActorName);

            if (!ChatRoom.ContainsKey(id))
            {
                ChatRoom.Add(id, a);
            }
        }
예제 #4
0
        private void AddActor(ChatMessage msg)
        {
            string id = string.Format("{0}_{1}", msg.ChatActor.ActorId, msg.ChatActor.ActorName);

            if (!ChatRoom.ContainsKey(id))
            {
                ChatRoom.Add(id, msg.ChatActor);
            }
            else
            {
                Console.WriteLine("Client with that ID already in chatroom...");
            }
        }