Example #1
0
 //
 // Invoked from the ChatRoomCallback implementation when a user sends a message
 // to the chat.
 //
 public void userSayEvent(long timestamp, String name, String message)
 {
     if (_chatView != null)
     {
         _chatView.appendMessage(ChatUtils.formatTimestamp(timestamp) + " - <" + name + "> " +
                                 ChatUtils.unstripHtml(message) + Environment.NewLine);
     }
 }
Example #2
0
 //
 // Invoked from the ChatRoomCallback implementation when a user joins the chat.
 //
 public void userJoinEvent(long timestamp, string name)
 {
     _users.Add(new User(name));
     if (_chatView != null)
     {
         _chatView.appendMessage(ChatUtils.formatTimestamp(timestamp) + " - <system-message> - " + name +
                                 " joined." + Environment.NewLine);
     }
 }
Example #3
0
        //
        // Invoked from the ChatRoomCallback implementation when a user leaves the chat.
        //
        public void userLeaveEvent(long timestamp, string name)
        {
            int index = _users.IndexOf(new User(name));

            if (index >= 0)
            {
                _users.RemoveAt(index);
                if (_chatView != null)
                {
                    _chatView.appendMessage(ChatUtils.formatTimestamp(timestamp) + " - <system-message> - " +
                                            name + " left." + Environment.NewLine);
                }
            }
        }