Ejemplo n.º 1
0
 void client_OnRoomLeft(object sender, ChatRoom room)
 {
     this.Invoke(new LoneSeekRoomEvent(OnRoomLeft), sender, room);
 }
Ejemplo n.º 2
0
 void client_OnChatMessage(object sender, ChatMessage message, ChatRoom room)
 {
     this.Invoke(new LoneSeekChatMessageEvent(OnChatMessage), sender, message, room);
 }
Ejemplo n.º 3
0
 void OnRoomLeft(object sender, ChatRoom room)
 {
     txText.AppendText("Left room: " + room.Name + "\r\n");
     txText.ScrollToCaret();
 }
Ejemplo n.º 4
0
        void OnRoomJoined(object sender, ChatRoom room)
        {
            lsUsers.Items.Clear();

            foreach (User user in room.Users)
            {
                lsUsers.Items.Add(user.Name);
            }
            txText.AppendText("Joined room " + room.Name + "\r\n");
            txText.AppendText("Users in the room " + room.UserCount.ToString() + "\r\n");
            txText.ScrollToCaret();
        }
Ejemplo n.º 5
0
 void OnChatMessage(object sender, ChatMessage message, ChatRoom room)
 {
     txText.AppendText("<" + message.Sender + "@" + message.Room + "> " + message.Message + "\r\n");
     txText.ScrollToCaret();
 }
Ejemplo n.º 6
0
        private void lvRooms_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            int selected = 0;

            if (lvRooms.SelectedIndices.Count > 0)
            { // Join this room.
                selected = lvRooms.SelectedIndices[0];
                joined = lvRooms.Items[selected].Tag as ChatRoom;
                // Join room.
                joined.Join();
            }
        }