public void updateUI(int index, string str) { if (this.listView1.InvokeRequired) { updateUICallback call = new updateUICallback(updateUI); this.Invoke(call, new object[] { index, str }); } else { this.listView1.Items[index].SubItems[5].Text = str; } }
//功能 : 更新client端的UI public void updateUI(string text, string type) { if (this.InvokeRequired) { updateUICallback updateUICallback = new updateUICallback(updateUI); this.Invoke(updateUICallback, text, type); } else { if (type.Equals("Monitor")) { Monitor.AppendText(text + "\n"); } if (type.Equals("List")) { List.Items.Clear(); foreach (Talkuser talkuser in userlist) { List.Items.Add(talkuser.Username); } } } }
//功能 : 更新server端的UI public void updateUI(string text, string type) { if (this.InvokeRequired) { updateUICallback updateUICallback = new updateUICallback(updateUI); this.Invoke(updateUICallback, text, type); } else { if (type.Equals("Monitor")) { monitor.AppendText(text); } if (type.Equals("List")) { list.Items.Add(text); } if (type.Equals("List-r")) { list.Items.Remove(text); } } }