Table of Contents

Class ProcessMonitor

Namespace
Artemis.Core.Services
Assembly
Artemis.Core.dll

Represents a monitor that efficiently keeps track of running processes.

public static class ProcessMonitor
Inheritance
object
ProcessMonitor

Properties

IsStarted

Gets a value indicating whether the monitoring has started.

public static bool IsStarted { get; }

Property Value

bool

LastUpdate

Gets the date time at which the last update took place.

public static DateTime LastUpdate { get; }

Property Value

DateTime

Processes

Gets an immutable array of the current processes.

public static ImmutableArray<ProcessInfo> Processes { get; }

Property Value

ImmutableArray<ProcessInfo>

UpdateInterval

Gets or sets the interval at which to update the list of processes.

public static TimeSpan UpdateInterval { get; set; }

Property Value

TimeSpan

Methods

IsProcessRunning(string?, string?)

Returns whether the specified process is running

public static bool IsProcessRunning(string? processName = null, string? processLocation = null)

Parameters

processName string

The name of the process to check

processLocation string

The location of where the process must be running from (optional)

Returns

bool

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

EventHandler<ProcessEventArgs>

ProcessStopped

Occurs when a process is stopped.

public static event EventHandler<ProcessEventArgs>? ProcessStopped

Event Type

EventHandler<ProcessEventArgs>