public string ExecuteCommand(IRemoteClient remoteClient, IEnumerable <string> parameters) { var decorator = new ClientInformationDecorator(remoteClient); var duration = decorator.Ping(); return(string.Format("Ping to client : {0} ms", duration)); }
protected override void HandleInternal(CommandLine commandLine, IRemoteClient remoteClient) { var decorator = new ClientInformationDecorator(remoteClient); var information = decorator.GetFullClientInformation(); WriteInfo("** User information"); WriteInfo("\t- User name : {0}", information.UserName); WriteInfo("\t- User domain name : {0}", information.UserDomainName); WriteInfo(); WriteInfo("** Machine information"); WriteInfo("\t- Machine name : {0}", information.MachineName); WriteInfo("\t- Public Ip : {0}", information.PublicIp); WriteInfo("\t- Operating system : {0}", information.OperatingSystem); WriteInfo(); WriteInfo("** Network interfaces"); foreach (var networkInformation in information.NetworkInterfaces) { WriteInfo("\t{0}", networkInformation.Name); WriteInfo("\t - Description : {0}", networkInformation.Description); foreach (var address in networkInformation.Addresses) { WriteInfo("\t - Address : {0}", address); } WriteInfo(); } }
public ClientViewModel(IRemoteClient remoteClient) { RemoteClient = remoteClient; _clientInformationDecorator = new ClientInformationDecorator(RemoteClient); UpdateInformation(); }
protected override void HandleInternal(CommandLine commandLine, IRemoteClient remoteClient) { var decorator = new ClientInformationDecorator(remoteClient); for (var i = 0; i < 5; i++) { var duration = decorator.Ping(); WriteInfo(string.Format("Ping to client : {0} ms", duration)); Thread.Sleep(500); } }
public ClientViewModel(IRemoteClient remoteClient) { _remoteClient = remoteClient; _clientInformationDecorator = new ClientInformationDecorator(remoteClient); }