コード例 #1
0
        public static void SetPriority(string pid, ProcessPriorityClass priorityClass)
        {
            Process matchingProcess = ProcessFetcher.FetchByPid(pid);

            if (matchingProcess != null)
            {
                matchingProcess.PriorityClass = priorityClass;
            }
        }
コード例 #2
0
        public static void KillProcess(string pid)
        {
            Process matchingProcess = ProcessFetcher.FetchByPid(pid);

            if (matchingProcess != null)
            {
                matchingProcess.Kill();
            }
        }
コード例 #3
0
        private void LoadDetailsOfProcess(string pid)
        {
            Process selectedProcess = ProcessFetcher.FetchByPid(pid);

            if (selectedProcess == null)
            {
                return;
            }
            DisplayedProcess = MapProcessToDisplay(selectedProcess);
        }
コード例 #4
0
        private void RefreshProcessList()
        {
            if (SelectedProcess != null)
            {
                SelectedProcess = MapProcessForDisplay(ProcessFetcher.FetchByPid(SelectedProcess.Pid));
            }

            List <ProcessInListDisplay> ProcessesForDisplay = ProcessFetcher.Fetch()
                                                              .Select(process => MapProcessForDisplay(process))
                                                              .ToList();

            UpdateProcessListWithNewItems(ProcessesForDisplay);
        }
コード例 #5
0
 private bool IsProcessAlive(string pid)
 {
     return(ProcessFetcher.FetchByPid(pid) != null);
 }