From 4745f1856414cfc0213deeb4bf2e5d91bb92d44c Mon Sep 17 00:00:00 2001 From: Simon G Date: Sun, 25 Apr 2021 14:41:25 +0200 Subject: [PATCH] - add GetProcessById method --- Lib.ProcessManaging/ProcessManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib.ProcessManaging/ProcessManager.cs b/Lib.ProcessManaging/ProcessManager.cs index bd306c2..750f71f 100644 --- a/Lib.ProcessManaging/ProcessManager.cs +++ b/Lib.ProcessManaging/ProcessManager.cs @@ -42,6 +42,7 @@ namespace Lib.ProcessManaging monitorReadyEvent.WaitOne(); } + public IObservedProcess? GetProcessById(int id) => Processes.FirstOrDefault(p => p.Id == id); private void Monitor(object? state) { if (state is not ManualResetEvent monitorReadyEvent)