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

Butler

The butler is responsible for using the IWorkspaceManager and IMonitorManager to handle events from the IWindowManager to update the assignment of IWindows to IWorkspaces, and IWorkspaces to IMonitors.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IButler Butler { get; }

Property Value

IButler

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

MonitorManager

The manager for IMonitors.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IMonitorManager MonitorManager { get; }

Property Value

IMonitorManager

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

WindowManager

The manager for IWindows.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IWindowManager WindowManager { get; }

Property Value

IWindowManager

WorkspaceManager

Container responsible for the creation and removal of IWorkspaces. Events for workspaces are exposed here. To activate a workspace, or change the mapping between workspaces and monitors, use the IButler.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IWorkspaceManager WorkspaceManager { get; }

Property Value

IWorkspaceManager

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>