Class Utilities
Provides a few general utilities for ease of use
public static class Utilities
- Inheritance
-
objectUtilities
Methods
ApplyUpdate(bool)
Applies a pending update
public static void ApplyUpdate(bool silent)
Parameters
silentboolA boolean indicating whether to silently update or not.
CreateAccessibleDirectory(string)
Creates all directories and subdirectories in the specified path unless they already exist with permissions allowing access by everyone.
public static void CreateAccessibleDirectory(string path)
Parameters
pathstringThe directory to create.
OpenFolder(string)
Opens the provided folder in the user's file explorer
public static void OpenFolder(string path)
Parameters
pathstringThe full path of the folder to open
OpenUrl(string)
Opens the provided URL in the default web browser
public static Process? OpenUrl(string url)
Parameters
urlstringThe URL to open
Returns
- Process
The process created to open the URL
PrepareFirstLaunch()
Call this before even initializing the Core to make sure the folders required for operation are in place
public static void PrepareFirstLaunch()
Restart(bool, TimeSpan, params string[])
Restarts the application
public static void Restart(bool elevate, TimeSpan delay, params string[] extraArgs)
Parameters
elevateboolWhether the application should be restarted with elevated permissions
delayTimeSpanDelay in seconds before killing process and restarting
extraArgsstring[]A list of extra arguments to pass to Artemis when restarting
Shutdown()
Attempts to gracefully shut down the application with a delayed kill to ensure the application shut down
This is required because not all SDKs shut down properly, it is too unpredictable to just assume we can gracefully shut down
public static void Shutdown()
Events
RestartRequested
Occurs when the core has requested an application restart
public static event EventHandler<RestartEventArgs>? RestartRequested
Event Type
ShutdownRequested
Occurs when the core has requested an application shutdown
public static event EventHandler? ShutdownRequested
Event Type
UpdateRequested
Occurs when the core has requested a pending application update to be applied
public static event EventHandler<UpdateEventArgs>? UpdateRequested