Ejemplo n.º 1
0
 /// <summary> 在L_OnlineStatus中移除不在线的其它客户端信息</summary>
 private void RemoveUserName(string userName)
 {
     if (L_OnlineStatus.InvokeRequired)
     {
         RemoveUserNameDelegate d = RemoveUserName;
         L_OnlineStatus.Invoke(d, userName);
     }
     else
     {
         L_OnlineStatus.Items.Remove(userName);
         L_OnlineStatus.SelectedIndex = L_OnlineStatus.Items.Count - 1;
         L_OnlineStatus.ClearSelected();
     }
 }
Ejemplo n.º 2
0
 /// <summary> 在L_OnlineStatus中添加在线的其它客户端信息</summary>
 private void AddOnline(string userName)
 {
     if (L_OnlineStatus.InvokeRequired)
     {
         AddOnlineDelegate d = new AddOnlineDelegate(AddOnline);
         L_OnlineStatus.Invoke(d, new object[] { userName });
     }
     else
     {
         L_OnlineStatus.Items.Add(userName);
         L_OnlineStatus.SelectedIndex = L_OnlineStatus.Items.Count - 1;
         L_OnlineStatus.ClearSelected();
     }
 }