Exemple #1
0
 private void userListUpdate(object sender, UserListUpdateEventArgs e)
 {
    // If the window is open, refresh it.
    if (m_userListWindow != null)
       m_userListWindow.RefreshUserList();
 }
Exemple #2
0
 private void userListUpdate(object sender, UserListUpdateEventArgs e)
 {
    if (e != null)
    {
       if (m_userListForm.InvokeRequired)
       {
          m_userListForm.Invoke(new NoParamDelegate(UserListFormUpdate));
       }
       else
       {
          UserListFormUpdate();
       }
    }
 }
      public void HandleUserListUpdate(object sender, UserListUpdateEventArgs e)
      {
         if (e == null)
            return;

         // Update the user list in the model.
         // If this is not a delta, then we're being given a complete list of users in "addList".
         if (e.Delta == false)
         {
            m_userList = new UserList(e.AddList);
         }
         else
         {
            // This can happen if the UI never requests the userlist prior to
            // other server events happening.
            if (m_userList == null)
               m_userList = new UserList(null);

            // Otherwise, this IS a delta, so update the list appropriately.
            if (e.RemoveList != null && e.RemoveList.Count > 0)
            {
               IEnumerable<User> removes = e.RemoveList;
               LocalChatMessage(m_userList.FormatUserLeaveMsg(removes));
               m_userList.RemoveUsers(removes);
               m_soundController.PlaySound(SoundEffect.UserPart);
            }

            if (e.AddList != null && e.AddList.Count > 0)
            {
               IEnumerable<User> adds = e.AddList;
               LocalChatMessage(m_userList.FormatUserChangeMsg(adds));
               m_userList.AddUsers(adds);
               m_soundController.PlaySound(SoundEffect.UserJoin);
            }
         }

         // Raise the event.
         OnUserListUpdate(e);
      }
 protected virtual void OnUserListUpdate(UserListUpdateEventArgs e)
 {
    if (UserListUpdate != null)
       UserListUpdate(this, e);
 }
Exemple #5
0
      private void Event_UserListUpdate(object sender, UserListUpdateEventArgs e)
      {
         // Don't do anything in the case of a delta because the controller
         // already analyzes the changes and reports them as local chat text.
         if (e.Delta == true)
            return;

         // Dump complete userlist, because this non-delta response only arrives
         // in response to a "/who" command.
         if (e.AddList != null)
         {
            m_screen.WriteLine("---------------------");
            m_screen.WriteLine("User List:");
            foreach (User user in e.AddList)
            {
               m_screen.WriteLine(String.Format("   {0}", user.ToString()));
            }
            m_screen.WriteLine("---------------------");
         }
      }