예제 #1
0
 void ConnectionManager_Current_ClientDisconnected(object sender, LightClientInformationApp e)
 {
     if (e.Id == _controller.Client.Id)
     {
         Finish();
     }
 }
예제 #2
0
        private void ConnectClient(OnlineClientInformation clientInformation)
        {
            var existingClient = Clients.FirstOrDefault(x => x.Id == clientInformation.Id);
            var clientInfo     = new LightClientInformationApp {
                Id               = clientInformation.Id,
                UserName         = clientInformation.UserName,
                OsType           = clientInformation.OsType,
                ApiVersion       = clientInformation.ApiVersion,
                IsAdministrator  = clientInformation.IsAdministrator,
                IsServiceRunning = clientInformation.IsServiceRunning,
                IpAddress        = clientInformation.IpAddress,
                OnlineSince      = clientInformation.OnlineSince,
                Language         = clientInformation.Language,
                IsOnline         = clientInformation.IsOnline,
                Group            = clientInformation.Group,
                OsName           = clientInformation.OsName
            };

            if (existingClient == null)
            {
                Clients.Add(clientInfo);
            }
            else
            {
                Clients[Clients.IndexOf(existingClient)] = clientInfo;
            }

            if (ClientListChanged != null)
            {
                ClientListChanged.Invoke(this, EventArgs.Empty);
            }

            if (ClientConnected != null)
            {
                ClientConnected.Invoke(this, clientInformation);
            }
        }
예제 #3
0
 public ClientController(LightClientInformationApp clientInformation, TcpClient client, Sender sender)
 {
     Commander = new Commander(clientInformation, client, sender);
     Client    = clientInformation;
 }