Table of Contents

Class Pickers

Namespace
Whim
Assembly
Whim.dll
Pure pickers for IMapSector.
public static class Pickers
Inheritance
Pickers
Inherited Members

Methods

PickActiveLayoutEngine()

Get the active layout engine in the active workspace.
public static PurePicker<ILayoutEngine> PickActiveLayoutEngine()

Returns

PurePicker<ILayoutEngine>
The active layout engine in the active workspace, when passed to Pick<TResult>(PurePicker<TResult>).

PickActiveLayoutEngine(Guid)

Get the active layout engine in the provided workspace.
public static PurePicker<Result<ILayoutEngine>> PickActiveLayoutEngine(Guid workspaceId)

Parameters

workspaceId Guid

Returns

PurePicker<Result<ILayoutEngine>>
The active layout engine in the provided workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found, then DotNext.Result<T, TError>.Error will be returned.

PickActiveLayoutEngineByMonitor(HMONITOR)

Retrieves the active layout engine for the workspace on the given monitor.
public static PurePicker<Result<ILayoutEngine>> PickActiveLayoutEngineByMonitor(HMONITOR monitorHandle)

Parameters

monitorHandle HMONITOR
The handle of the monitor to get the active layout engine for.

Returns

PurePicker<Result<ILayoutEngine>>
The active layout engine for the workspace on the monitor, otherwise DotNext.Result<T, TError>.Error.

PickActiveMonitor()

Get the currently active monitor.
public static PurePicker<IMonitor> PickActiveMonitor()

Returns

PurePicker<IMonitor>
The active monitor, when passed to Pick<TResult>(PurePicker<TResult>).

PickActiveWorkspace()

Get the active workspace.
public static PurePicker<IWorkspace> PickActiveWorkspace()

Returns

PurePicker<IWorkspace>
The active workspace, when passed to Pick<TResult>(PurePicker<TResult>).

PickActiveWorkspaceId()

Get the id of the active workspace.
public static PurePicker<Guid> PickActiveWorkspaceId()

Returns

PurePicker<Guid>
The id of the active workspace, when passed to Pick<TResult>(PurePicker<TResult>).

PickActiveWorkspaceWindows()

Get all the windows in the active workspace.
public static PurePicker<IEnumerable<IWindow>> PickActiveWorkspaceWindows()

Returns

PurePicker<IEnumerable<IWindow>>
All the windows in the active workspace, when passed to Pick<TResult>(PurePicker<TResult>).

PickAdjacentMonitor(HMONITOR, bool, bool)

Gets the monitor before the given monitor.
public static PurePicker<Result<IMonitor>> PickAdjacentMonitor(HMONITOR handle = default, bool reverse = false, bool getFirst = false)

Parameters

handle HMONITOR
The handle of the monitor to use as a reference. Defaults to the current active monitor.
reverse bool
When true, gets the previous monitor, otherwise gets the next monitor. Defaults to false.
getFirst bool
When true, then returns the first monitor. Otherwise returns an exception in the result.

Returns

PurePicker<Result<IMonitor>>
The monitor adjacent to the given monitor, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor is not found, then DotNext.Result<T, TError>.Error will be returned.

PickAdjacentWorkspace(Guid, bool, bool)

Gets the adjacent workspace for the given workspace.
public static PurePicker<Result<IWorkspace>> PickAdjacentWorkspace(Guid workspaceId, bool reverse = false, bool skipActive = false)

Parameters

workspaceId Guid
The workspace to get the adjacent workspace for.
reverse bool
When true, gets the previous workspace, otherwise gets the next workspace. Defaults to false.
skipActive bool
When true, skips all workspaces that are active on any other monitor. Defaults to false.

Returns

PurePicker<Result<IWorkspace>>
The adjacent workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found or there are no adjacent workspaces, then DotNext.Result<T, TError>.Error will be returned.

PickAllActiveWorkspaces()

Gets all the workspaces which are active on any monitor.
public static PurePicker<IEnumerable<IWorkspace>> PickAllActiveWorkspaces()

Returns

PurePicker<IEnumerable<IWorkspace>>
All the active workspaces, when passed to Pick<TResult>(PurePicker<TResult>).

PickAllMonitors()

Get all the IMonitors tracked by Whim.
public static PurePicker<IReadOnlyList<IMonitor>> PickAllMonitors()

Returns

PurePicker<IReadOnlyList<IMonitor>>
The monitors, when passed to Pick<TResult>(PurePicker<TResult>).

PickAllWindows()

Get all the IWindows tracked by Whim.
public static PurePicker<IEnumerable<IWindow>> PickAllWindows()

Returns

PurePicker<IEnumerable<IWindow>>

PickCreateLeafLayoutEngines()

Picks the function used to create the default layout engines to add to a workspace.
public static PurePicker<Func<CreateLeafLayoutEngine[]>> PickCreateLeafLayoutEngines()

Returns

PurePicker<Func<CreateLeafLayoutEngine[]>>
The function used to create the default layout engines to add to a workspace, when passed to Pick<TResult>(PurePicker<TResult>).

PickExplicitStickyMonitorIndicesByWorkspace(Guid)

Retrieves the explicit indices of the monitors which can show the given workspace.
public static PurePicker<Result<IReadOnlyList<int>>> PickExplicitStickyMonitorIndicesByWorkspace(Guid workspaceId)

Parameters

workspaceId Guid
The ID of the workspace to get the monitor indices for.

Returns

PurePicker<Result<IReadOnlyList<int>>>
The explicit indices of the monitors which can show the workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace cannot be found, or if the workspace has no explicit mappings, then an error is returned.

PickIsStartupWindow(HWND)

Returns whether a window was open when Whim started.
public static PurePicker<bool> PickIsStartupWindow(HWND handle)

Parameters

handle HWND

Returns

PurePicker<bool>

PickLastFocusedWindow(Guid)

Get the last focused window in the provided workspace.
public static PurePicker<Result<IWindow>> PickLastFocusedWindow(Guid workspaceId = default)

Parameters

workspaceId Guid
The workspace to get the last focused window for. Defaults to the active workspace

Returns

PurePicker<Result<IWindow>>
The last focused window in the provided workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found or there is no last focused window, then DotNext.Result<T, TError>.Error will be returned.

PickLastFocusedWindowHandle(Guid)

Get the last focused window handle in the provided workspace.
public static PurePicker<Result<HWND>> PickLastFocusedWindowHandle(Guid workspaceId = default)

Parameters

workspaceId Guid
The workspace to get the last focused window handle for. Defaults to the active workspace

Returns

PurePicker<Result<HWND>>
If the workspace is not found or there is no last focused window, then DotNext.Result<T, TError>.Error will be returned.

PickLastWhimActiveMonitor()

Get the last IMonitor which received an event sent by Windows which Whim did not ignore.
public static PurePicker<IMonitor> PickLastWhimActiveMonitor()

Returns

PurePicker<IMonitor>
The last monitor which received an event, when passed to Pick<TResult>(PurePicker<TResult>).

PickMonitorAtPoint(IPoint<int>, bool)

Get the monitor at the point point
public static Picker<Result<IMonitor>> PickMonitorAtPoint(IPoint<int> point, bool getFirst = false)

Parameters

point IPoint<int>
The point to get the monitor for.
getFirst bool
When true, then returns the first monitor. Otherwise returns an exception in the result.

Returns

Picker<Result<IMonitor>>
The monitor at the given point, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor is not found, then DotNext.Result<T, TError>.Error will be returned.

PickMonitorByHandle(HMONITOR)

Get a monitor by its HMONITOR handle.
public static PurePicker<Result<IMonitor>> PickMonitorByHandle(HMONITOR handle)

Parameters

handle HMONITOR

Returns

PurePicker<Result<IMonitor>>
The monitor with the given handle, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor is not found, then DotNext.Result<T, TError>.Error will be returned.

PickMonitorByIndex(int)

Get the monitor at the given index.
public static PurePicker<Result<IMonitor>> PickMonitorByIndex(int index)

Parameters

index int
The 0-based index of the monitor to get.

Returns

PurePicker<Result<IMonitor>>
The monitor at the given index, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor is not found, then DotNext.Result<T, TError>.Error will be returned.

PickMonitorByWindow(HWND)

Retrieves the monitor for the given window.
public static PurePicker<Result<IMonitor>> PickMonitorByWindow(HWND windowHandle)

Parameters

windowHandle HWND
The handle of the window to get the monitor for.

Returns

PurePicker<Result<IMonitor>>
The monitor for the window, when passed to Pick<TResult>(PurePicker<TResult>). If the window is not tracked or does not appear on any monitor, then DotNext.Result<T, TError>.Error will be returned.

PickMonitorByWorkspace(Guid)

Retrieves the monitor for the given workspace.
public static PurePicker<Result<IMonitor>> PickMonitorByWorkspace(Guid searchWorkspaceId)

Parameters

searchWorkspaceId Guid
The ID of the workspace to get the monitor for.

Returns

PurePicker<Result<IMonitor>>
The monitor for the workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found or does not appear on any monitor, then DotNext.Result<T, TError>.Error will be returned.

PickPrimaryMonitor()

Get the primary monitor.
public static PurePicker<IMonitor> PickPrimaryMonitor()

Returns

PurePicker<IMonitor>
The primary monitor, when passed to Pick<TResult>(PurePicker<TResult>).

PickStickyMonitorsByWorkspace(Guid)

Retrieves the handles of the monitors which can show the given workspace. This includes workspaces which explicitly state which monitors they can be shown on, and workspaces which can be shown on any monitor (i.e., they don't specify any monitors).
public static PurePicker<Result<IReadOnlyList<HMONITOR>>> PickStickyMonitorsByWorkspace(Guid workspaceId)

Parameters

workspaceId Guid
The ID of the workspace to get the monitors for.

Returns

PurePicker<Result<IReadOnlyList<HMONITOR>>>
The handles of the monitors which can show the workspace, when passed to Pick<TResult>(PurePicker<TResult>). If there are no explicit monitors which can show the workspace, then all monitors will be returned. If the workspace is not found, then DotNext.Result<T, TError>.Error will be returned.

PickStickyWorkspacesByMonitor(HMONITOR)

Retrieves the workspaces which can be shown on the given monitor.
public static PurePicker<Result<IReadOnlyList<IWorkspace>>> PickStickyWorkspacesByMonitor(HMONITOR monitorHandle)

Parameters

monitorHandle HMONITOR
The handle of the monitor to get the workspaces for.

Returns

PurePicker<Result<IReadOnlyList<IWorkspace>>>
The workspaces which can be shown on the monitor, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor can't be found, then an error is returned.

PickValidMonitorByWorkspace(Guid, HMONITOR)

Retrieves the first suitable monitor for a workspace, if one is not provided. A monitor is suitable for a workspace if:
  • If the workspace lists the monitor's index as one of its sticky monitors
  • If the workspace does not list any sticky monitors
  • If the workspace lists all non-existent monitors as sticky monitors
The order of suitability is:
  1. The provided monitorHandle
  2. The last monitor the workspace was activated on
  3. The first available monitor
public static PurePicker<Result<HMONITOR>> PickValidMonitorByWorkspace(Guid workspaceId, HMONITOR monitorHandle = default)

Parameters

workspaceId Guid
The ID of the workspace to get the monitor for.
monitorHandle HMONITOR
The preferred monitor to use. If not provided, the last monitor the workspace was activated on will next be tried.

Returns

PurePicker<Result<HMONITOR>>
The first valid monitor for the workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace can't be found, then an error is returned.

PickWindowByHandle(HWND)

Try to get a IWindow by its HWND handle.
public static PurePicker<Result<IWindow>> PickWindowByHandle(HWND handle)

Parameters

handle HWND

Returns

PurePicker<Result<IWindow>>

PickWindowPosition(Guid, HWND)

Get the window position in the provided workspace.
public static PurePicker<Result<WindowPosition>> PickWindowPosition(Guid workspaceId, HWND windowHandle)

Parameters

workspaceId Guid
The workspace to get the window position for.
windowHandle HWND
The window handle to get the position for.

Returns

PurePicker<Result<WindowPosition>>
The window position in the provided workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found or the window is not found in the workspace, then DotNext.Result<T, TError>.Error will be returned.

PickWindowPosition(HWND)

Get the window position for the given windowHandle.
public static PurePicker<Result<WindowPosition>> PickWindowPosition(HWND windowHandle)

Parameters

windowHandle HWND
The window handle to get the position for.

Returns

PurePicker<Result<WindowPosition>>
The window position for the given windowHandle, when passed to Pick<TResult>(PurePicker<TResult>). If the window is not found, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaceById(Guid)

Get the workspace with the provided workspaceId.
public static PurePicker<Result<IWorkspace>> PickWorkspaceById(Guid workspaceId)

Parameters

workspaceId Guid

Returns

PurePicker<Result<IWorkspace>>
The workspace with the provided workspaceId, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaceByMonitor(HMONITOR)

Retrieves the workspace shown on the given monitor.
public static PurePicker<Result<IWorkspace>> PickWorkspaceByMonitor(HMONITOR monitorHandle)

Parameters

monitorHandle HMONITOR
The handle of the monitor to get the workspace for.

Returns

PurePicker<Result<IWorkspace>>
The workspace shown on the monitor, when passed to Pick<TResult>(PurePicker<TResult>). If the monitor is not found, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaceByName(string)

Get the workspace with the provided name.
public static PurePicker<Result<IWorkspace>> PickWorkspaceByName(string name)

Parameters

name string

Returns

PurePicker<Result<IWorkspace>>
The workspace with the provided name, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaceByWindow(HWND)

Retrieves the workspace for the given window.
public static PurePicker<Result<IWorkspace>> PickWorkspaceByWindow(HWND windowHandle)

Parameters

windowHandle HWND

Returns

PurePicker<Result<IWorkspace>>
The workspace for the window, when passed to Pick<TResult>(PurePicker<TResult>). If the window is not tracked or does not belong to any workspace, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaceWindows(Guid)

Get all the windows in the provided workspace.
public static PurePicker<Result<IEnumerable<IWindow>>> PickWorkspaceWindows(Guid workspaceId)

Parameters

workspaceId Guid

Returns

PurePicker<Result<IEnumerable<IWindow>>>
All the windows in the provided workspace, when passed to Pick<TResult>(PurePicker<TResult>). If the workspace is not found, then DotNext.Result<T, TError>.Error will be returned.

PickWorkspaces()

Get all workspaces.
public static PurePicker<IEnumerable<IWorkspace>> PickWorkspaces()

Returns

PurePicker<IEnumerable<IWorkspace>>
All workspaces, when passed to Pick<TResult>(PurePicker<TResult>).