Ejemplo n.º 1
0
        /// <summary>
        /// Static method that is invoked when a client decides to join the chat.
        /// </summary>
        static void OnJoinChat(IClient client)
        {
            // We add the person to the chat room
            if (!PeopleInChat.Contains(client))
            {
                // Generate the avatar for the client
                client["Avatar"] = IdenticonRenderer.Create(client);

                // Add the person in the room
                PeopleInChat.Add(client);

                // Say something nice
                SayTo(client, "Welcome to CodeWithMe :)");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Static method that is ivoked when a client decides to join the chat.
        /// </summary>
        static void OnJoinChat(IClient client)
        {
            // We add the person to the chat room
            if (!PeopleInChat.Contains(client))
            {
                // Generate the avatar for the client
                client["Avatar"] = IdenticonRenderer.Create(client);

                // Add the person in the room
                PeopleInChat.Add(client);

                // Say something nice
                SayTo(client, "Hi, I'm the author of this sample, hope you like it! Just type a message below and see how it works on CodeProject.");
            }
        }