コード例 #1
0
 private void TCP_Client_ConnectionStateEvent(AssaultBird2454.VPTU.Networking.Data.Client_ConnectionStatus ConnectionState)
 {
     State.Dispatcher.Invoke(new Action(() => State.Content = ConnectionState.ToString()));
 }
コード例 #2
0
        private void Server_TCP_ClientState_Changed(AssaultBird2454.VPTU.Networking.Server.TCP.TCP_ClientNode Client, AssaultBird2454.VPTU.Networking.Data.Client_ConnectionStatus Client_State)
        {
            if (Client_State == AssaultBird2454.VPTU.Networking.Data.Client_ConnectionStatus.Connected)
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    this.ClientList.Add(Client);
                }));
            }
            else if (Client_State == AssaultBird2454.VPTU.Networking.Data.Client_ConnectionStatus.Disconnected)
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    try { this.ClientList.Remove(Client); } catch { }
                }));
            }
            else if (Client_State == AssaultBird2454.VPTU.Networking.Data.Client_ConnectionStatus.Rejected)
            {
                this.Dispatcher.Invoke(new Action(() =>
                {
                    try { this.ClientList.Remove(Client); } catch { }
                }));
            }

            //Clients.Dispatcher.Invoke(new Action(() => Clients.Items.Refresh()));
        }