public static void SetPriority(string pid, ProcessPriorityClass priorityClass) { Process matchingProcess = ProcessFetcher.FetchByPid(pid); if (matchingProcess != null) { matchingProcess.PriorityClass = priorityClass; } }
public static void KillProcess(string pid) { Process matchingProcess = ProcessFetcher.FetchByPid(pid); if (matchingProcess != null) { matchingProcess.Kill(); } }
private void LoadDetailsOfProcess(string pid) { Process selectedProcess = ProcessFetcher.FetchByPid(pid); if (selectedProcess == null) { return; } DisplayedProcess = MapProcessToDisplay(selectedProcess); }
private void RefreshProcessList() { if (SelectedProcess != null) { SelectedProcess = MapProcessForDisplay(ProcessFetcher.FetchByPid(SelectedProcess.Pid)); } List <ProcessInListDisplay> ProcessesForDisplay = ProcessFetcher.Fetch() .Select(process => MapProcessForDisplay(process)) .ToList(); UpdateProcessListWithNewItems(ProcessesForDisplay); }
private bool IsProcessAlive(string pid) { return(ProcessFetcher.FetchByPid(pid) != null); }