예제 #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);
 }