コード例 #1
0
 public ComputerController(
     IComputerComponentService computerComponentService,
     IComputerSystemService computerSystemService,
     IProcessService processService
     )
 {
     _computerComponentService = computerComponentService;
     _processService           = processService;
     _computerSystemService    = computerSystemService;
 }
コード例 #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();
        }
コード例 #3
0
 public ComputerSystemController(IComputerSystemService computerSystemService)
 {
     _computerSystemService = computerSystemService;
 }