public void AddListBoxItemAction(List <MyListBoxItem> sList, MyListBoxItem one) { Action <List <MyListBoxItem>, MyListBoxItem> addListBoxItemAction = new Action <List <MyListBoxItem>, MyListBoxItem>(AddListBoxItem); this.Dispatcher.BeginInvoke(addListBoxItemAction, sList, one); }
public void RemoveListBoxItemAction(List <MyListBoxItem> sList, MyListBoxItem one) { Action <List <MyListBoxItem>, MyListBoxItem> removeListBoxItemAction = new Action <List <MyListBoxItem>, MyListBoxItem>(RemoveListBoxItem); this.Dispatcher.BeginInvoke(removeListBoxItemAction, sList, one); }
private void OnWeaveDeleteSocket(WeaveOnLine weaveOnLine) { SetServerReceiveText("Socket断开--退出事件--触发了一次(OnWeaveDeleteSocket)" + Environment.NewLine); RemoveListBoxItemAction(connectedSocketItemList, CopyWeaveOnLineToMyListBoxItem(weaveOnLine)); MyListBoxItem oneItem = loginedUserList.Find(item => item.Ip == weaveOnLine.Socket.RemoteEndPoint.ToString()); RemoveListBoxItemAction(loginedUserList, oneItem); }
public void RemoveListBoxItem(List <MyListBoxItem> sList, MyListBoxItem one) { MyListBoxItem item = sList.Find(i => i.Ip == one.Ip); if (item != null) { sList.Remove(item); } CheckListBoxSource(); }
public MyListBoxItem CopyWeaveOnLineToMyListBoxItem(WeaveOnLine one) { MyListBoxItem item = new MyListBoxItem() { UIName_Id = one.Socket.RemoteEndPoint.ToString(), ShowMsg = "UserIP:" + one.Socket.RemoteEndPoint.ToString() + " -Token:" + one.Token, UserName = "******" + one.Socket.RemoteEndPoint.ToString(), Ip = one.Socket.RemoteEndPoint.ToString() }; return(item); }
public MyListBoxItem CopyUnityPlayerOnClientToMyListBoxItem(UnityPlayerOnClient one) { MyListBoxItem item = new MyListBoxItem() { UIName_Id = one.Socket.RemoteEndPoint.ToString(), ShowMsg = "UserIP:" + one.Socket.RemoteEndPoint.ToString() + " -Token:" + one.Token, UserName = one.UserName, Ip = one.Socket.RemoteEndPoint.ToString() }; return(item); }
public void AddListBoxItem(List <MyListBoxItem> sList, MyListBoxItem one) { sList.Add(one); CheckListBoxSource(); }