Table of Contents

Class Utilities

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Provides a few general utilities for ease of use

public static class Utilities
Inheritance
object
Utilities

Methods

ApplyUpdate(bool)

Applies a pending update

public static void ApplyUpdate(bool silent)

Parameters

silent bool

A 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

path string

The directory to create.

OpenFolder(string)

Opens the provided folder in the user's file explorer

public static void OpenFolder(string path)

Parameters

path string

The 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

url string

The 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

elevate bool

Whether the application should be restarted with elevated permissions

delay TimeSpan

Delay in seconds before killing process and restarting

extraArgs string[]

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

EventHandler<RestartEventArgs>

ShutdownRequested

Occurs when the core has requested an application shutdown

public static event EventHandler? ShutdownRequested

Event Type

EventHandler

UpdateRequested

Occurs when the core has requested a pending application update to be applied

public static event EventHandler<UpdateEventArgs>? UpdateRequested

Event Type

EventHandler<UpdateEventArgs>