Class ProcessMonitor
Represents a monitor that efficiently keeps track of running processes.
public static class ProcessMonitor
- Inheritance
-
objectProcessMonitor
Properties
IsStarted
Gets a value indicating whether the monitoring has started.
public static bool IsStarted { get; }
Property Value
LastUpdate
Gets the date time at which the last update took place.
public static DateTime LastUpdate { get; }
Property Value
Processes
Gets an immutable array of the current processes.
public static ImmutableArray<ProcessInfo> Processes { get; }
Property Value
UpdateInterval
Gets or sets the interval at which to update the list of processes.
public static TimeSpan UpdateInterval { get; set; }
Property Value
Methods
IsProcessRunning(string?, string?)
Returns whether the specified process is running
public static bool IsProcessRunning(string? processName = null, string? processLocation = null)
Parameters
processNamestringThe name of the process to check
processLocationstringThe location of where the process must be running from (optional)
Returns
Start()
Starts monitoring processes.
public static void Start()
Stop()
Stops monitoring processes.
public static void Stop()
Events
ProcessStarted
Occurs when a new process is started.
public static event EventHandler<ProcessEventArgs>? ProcessStarted
Event Type
ProcessStopped
Occurs when a process is stopped.
public static event EventHandler<ProcessEventArgs>? ProcessStopped