Table of Contents

Interface IContext

Namespace
Whim
Assembly
Whim.dll
This is the core of Whim.
IContext consists of managers which contain and control Whim's state, and functionality.
IContext also contains other associated state and functionality, like the Logger.
public interface IContext

Properties

CommandManager

ICommandManager is responsible for managing all the commands for Whim.
ICommandManager CommandManager { get; }

Property Value

ICommandManager

FileManager

Manages files and directories for Whim.
IFileManager FileManager { get; }

Property Value

IFileManager

FilterManager

Manages filters for IWindows.
IFilterManager FilterManager { get; }

Property Value

IFilterManager

KeybindManager

IKeybindManager is responsible for managing all the keybinds for Whim.
IKeybindManager KeybindManager { get; }

Property Value

IKeybindManager

Logger

Logger Logger { get; }

Property Value

Logger

NativeManager

Manager for interacting with native Windows APIs.
INativeManager NativeManager { get; }

Property Value

INativeManager

NotificationManager

The notification manager allows the sending of toast notifications to the user.
INotificationManager NotificationManager { get; }

Property Value

INotificationManager

PluginManager

Manager for the loaded plugins.
IPluginManager PluginManager { get; }

Property Value

IPluginManager

ResourceManager

Interface to load package and user ResourceDictionary.
IResourceManager ResourceManager { get; }

Property Value

IResourceManager

RouterManager

Manages routers for IWindows.
IRouterManager RouterManager { get; }

Property Value

IRouterManager

Store

Contains the state of Whim's monitors, windows, and workspaces.
IStore Store { get; }

Property Value

IStore

UncaughtExceptionHandling

UncaughtExceptionHandling UncaughtExceptionHandling { get; set; }

Property Value

UncaughtExceptionHandling

WindowProcessorManager

The container for custom window processors. These are used to handle windows with non-standard behavior. For example, Firefox will try reset the window position on startup. The FirefoxWindowProcessor will ignore these events.
IWindowProcessorManager WindowProcessorManager { get; }

Property Value

IWindowProcessorManager

Methods

CreateWindow(HWND)

Creates a new window. If the window cannot be created, null is returned. This will try reuse existing IWindows if possible.
Result<IWindow> CreateWindow(HWND hWnd)

Parameters

hWnd HWND
The window handle.

Returns

Result<IWindow>

Remarks

This method will mainly be used to add existing windows to Whim.

Exit(ExitEventArgs?)

This is called to shutdown the context.
void Exit(ExitEventArgs? args = null)

Parameters

args ExitEventArgs
The shutdown event arguments. If this is not provided, we assume User.

HandleUncaughtException(string, Exception)

Handles an uncaught exception, according to UncaughtExceptionHandling. Place this in a catch block where re-entry can occur - for example, in a Win32 hook.
void HandleUncaughtException(string procName, Exception exception)

Parameters

procName string
exception Exception

Initialize()

This will be called by the Whim Runner. You likely won't need to call it yourself.
void Initialize()

Exceptions

ConfigLoaderException
Thrown if the user's config could not be loaded.

Events

Exited

This event is fired after the context has been shut down.
event EventHandler<ExitEventArgs>? Exited

Event Type

EventHandler<ExitEventArgs>

Exiting

This event is fired when the context is shutting down.
event EventHandler<ExitEventArgs>? Exiting

Event Type

EventHandler<ExitEventArgs>