public int KillGroup(ProcessPriority processPriority) { int removedProcessCount = 0; for (int i = _processList.Count - 1; i >= 0; i--) { if (processPriority == _processList[i].ProcessPriority) { _processList[i].Kill(); _processList.RemoveAt(i); removedProcessCount++; } } if (removedProcessCount == 0) { Console.WriteLine("Processes with priority:{0} don't exists", processPriority.ToString()); } return(removedProcessCount); }
public void Kill() { Console.WriteLine(String.Format("Killed process PID:{0,3} with priority:{1,-6} created:{2} ms:{3}", _pid, _processPriority.ToString(), _creationTime, _creationTime.ToString("ffff"))); }