public void KillAll() { foreach (var process in _repository.GetAllSortedByDate()) { process.Kill(); _repository.Remove(process.PID); } }
public bool AddProcess(Process process) { if (_repository.GetSize() >= _maxSize) { var oldest = _repository.GetAllSortedByDate().FirstOrDefault(); _repository.Remove(oldest.PID); } _repository.Save(process); return(true); }