示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        public void RemoveListBoxItem(List <MyListBoxItem> sList, MyListBoxItem one)
        {
            MyListBoxItem item = sList.Find(i => i.Ip == one.Ip);

            if (item != null)
            {
                sList.Remove(item);
            }


            CheckListBoxSource();
        }
示例#5
0
        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);
        }
示例#6
0
        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);
        }
示例#7
0
 public void AddListBoxItem(List <MyListBoxItem> sList, MyListBoxItem one)
 {
     sList.Add(one);
     CheckListBoxSource();
 }