public string GetProcessInformationById(ClientCommandRequest clientCommandRequest)
        {
            OperatingSystemInformationController operatingSystemInformationController =
                (OperatingSystemInformationController)_serviceProvider.GetService(typeof(OperatingSystemInformationController));
            ProcessInformationDTO processDTO = operatingSystemInformationController
                                               .GetProcessInformationById(int.Parse(clientCommandRequest.Arguments));

            return(JsonConvert.SerializeObject(processDTO));
        }
        public ServerResponseInformation GetProcessInformationByName
            (ClientCommandInformation clientCommand)
        {
            AuthorizeController authorizeController = (AuthorizeController)_serviceProvider
                                                      .GetService(typeof(AuthorizeController));
            var resAuthorize = authorizeController.Authorize(clientCommand.ClientLogin);

            if (resAuthorize != null)
            {
                return(resAuthorize);
            }

            ProcessInformationDTO processInformationDTO = JsonConvert
                                                          .DeserializeObject <ProcessInformationDTO>(clientCommand.SerializedData);
            ProcessesController processesController = (ProcessesController)_serviceProvider
                                                      .GetService(typeof(ProcessesController));

            return(processesController.RecieveProcessInformation(processInformationDTO, clientCommand.ClientLogin));
        }
示例#3
0
        public IEnumerable <ProcessDTO> GetTopMemoryUsageProcesses()
        {
            IEnumerable <ProcessPerfomanceDTO> processesPerfomance = _processPerfomanceService
                                                                     .GetTopMemoryUsageProcessesPerfomances(10);
            IList <ProcessDTO> processes = new List <ProcessDTO>(10);

            foreach (ProcessPerfomanceDTO processPerfomance in processesPerfomance)
            {
                ProcessInformationDTO processInformation = _processInformationService
                                                           .GetProcessInformationById(processPerfomance.ProcessId);
                ProcessDTO process = new ProcessDTO
                {
                    Information           = processInformation,
                    PerfomanceInformation = processPerfomance,
                    ProcessId             = processPerfomance.ProcessId
                };
                processes.Add(process);
            }
            return(processes);
        }
 public ServerResponseInformation RecieveProcessInformation
     (ProcessInformationDTO processInformation, ClientLoginModel clientLogin)
 {
     try
     {
         _processService.UpdateProcessInformation(clientLogin.Login, processInformation);
         return(new ServerResponseInformation
         {
             Status = 1,
             SerializedData = "Success"
         });
     }
     catch (ServerServicesException exception)
     {
         return(new ServerResponseInformation
         {
             Status = -1,
             SerializedData = exception.Message
         });
     }
 }
示例#5
0
        public ComputerOperatingInformationDTO GetComputerOperatingInformation()
        {
            IEnumerable <ProcessPerfomanceDTO> processesPerfomance = _processPerfomanceService
                                                                     .GetTopCPUUsageProcessesPerfomances(10);
            IList <ProcessDTO> processes = new List <ProcessDTO>(10);

            foreach (ProcessPerfomanceDTO processPerfomance in processesPerfomance)
            {
                ProcessInformationDTO processInformation = _processInformationService
                                                           .GetProcessInformationById(processPerfomance.ProcessId);
                ProcessDTO process = new ProcessDTO {
                    Information           = processInformation,
                    PerfomanceInformation = processPerfomance,
                    ProcessId             = processPerfomance.ProcessId
                };
                processes.Add(process);
            }
            return(new ComputerOperatingInformationDTO {
                ComputerInformation = _computerSystemService.GetComputerSystemInformation(),
                CurrentProcesses = processes
            });
        }
 public void UpdateProcessInformation(string computerLogin, ProcessInformationDTO processInfromation)
 {
     throw new NotImplementedException();
 }