Exemplo n.º 1
0
 public ComputerController(
     IComputerComponentService computerComponentService,
     IComputerSystemService computerSystemService,
     IProcessService processService
     )
 {
     _computerComponentService = computerComponentService;
     _processService           = processService;
     _computerSystemService    = computerSystemService;
 }
Exemplo n.º 2
0
        public async void AsyncUpdateSystemInformation(object parameter = null)
        {
            IsModelInformationBeingUpdated = true;
            _modelActivity = "(Fetching System Info)";
            RaisePropertyChanged("ModelTarget");
            UpdateSystemInformationCommand.RaiseCanExecuteChanged();
            System = await Task.Run(() =>
            {
                IServiceFactory sf = ServiceFactoryProducer.GetServiceFactory();

                IComputerSystemService css = sf.CreateComputerSystemService();

                return(css.GetComputerSystem());
            });

            CpuInfo = new CPUInfoViewModel(_system.CpuInfo);

            IsModelInformationBeingUpdated = false;
            _modelActivity      = "(Idle)";
            PhysicalMemoryCount = System.PhysicalMemoryCollection.Count;


            ulong tpm = 0;

            foreach (PhysicalMemory pm in System.PhysicalMemoryCollection)
            {
                tpm += pm.Capacity;
            }

            TotalPhysicalMemoryInt = tpm;
            FreePhysicalMemoryInt  = System.FreePhysicalMemory;
            UsedPhysicalMemoryInt  = TotalPhysicalMemoryInt - FreePhysicalMemoryInt;
            MemoryAllocation       = _usedPhysicalMemoryInt / 1024 / 1024 + " / " + _totalPhysicalMemoryInt / 1024 / 1024 + " MegaBytes";
            RaisePropertyChanged("ModelTarget");
            UpdateSystemInformationCommand.RaiseCanExecuteChanged();
        }
Exemplo n.º 3
0
 public ComputerSystemController(IComputerSystemService computerSystemService)
 {
     _computerSystemService = computerSystemService;
 }