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
CommandManager
ICommandManager is responsible for managing all the commands for Whim.
ICommandManager CommandManager { get; }
Property Value
FileManager
Manages files and directories for Whim.
IFileManager FileManager { get; }
Property Value
FilterManager
Manages filters for IWindows.
IFilterManager FilterManager { get; }
Property Value
KeybindManager
IKeybindManager
is responsible for managing all the keybinds for Whim.IKeybindManager KeybindManager { get; }
Property Value
Logger
Logger Logger { get; }
Property Value
MonitorManager
The manager for IMonitors.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IMonitorManager MonitorManager { get; }
Property Value
NativeManager
Manager for interacting with native Windows APIs.
INativeManager NativeManager { get; }
Property Value
NotificationManager
The notification manager allows the sending of toast notifications to the user.
INotificationManager NotificationManager { get; }
Property Value
PluginManager
Manager for the loaded plugins.
IPluginManager PluginManager { get; }
Property Value
ResourceManager
Interface to load package and user ResourceDictionary.
IResourceManager ResourceManager { get; }
Property Value
RouterManager
Manages routers for IWindows.
IRouterManager RouterManager { get; }
Property Value
Store
Contains the state of Whim's monitors, windows, and workspaces.
IStore Store { get; }
Property Value
UncaughtExceptionHandling
UncaughtExceptionHandling UncaughtExceptionHandling { get; set; }
Property Value
WindowManager
The manager for IWindows.
[Obsolete("Use transforms and pickers to interact with the store instead")]
IWindowManager WindowManager { get; }
Property Value
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
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
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
Exiting
This event is fired when the context is shutting down.
event EventHandler<ExitEventArgs>? Exiting