Table of Contents

Interface IStore

Namespace
Whim
Assembly
Whim.dll
Contains the state of Whim's monitors, windows, and workspaces.
public interface IStore : IDisposable
Inherited Members

Properties

IsDisposing

Whether the store is being disposed.
bool IsDisposing { get; }

Property Value

bool

MapEvents

Events relating to the mapping of IWindows to IWorkspaces and IWorkspaces to IMonitors.
IMapSectorEvents MapEvents { get; }

Property Value

IMapSectorEvents

MonitorEvents

The events raised by the IMonitorSector.
IMonitorSectorEvents MonitorEvents { get; }

Property Value

IMonitorSectorEvents

WindowEvents

Events for the IWindowSector
IWindowSectorEvents WindowEvents { get; }

Property Value

IWindowSectorEvents

WorkspaceEvents

The events raised by the IWorkspaceSector.
IWorkspaceSectorEvents WorkspaceEvents { get; }

Property Value

IWorkspaceSectorEvents

Methods

Dispatch<TResult>(Transform<TResult>)

Dispatch updates to transform Whim's state.
Result<TResult> Dispatch<TResult>(Transform<TResult> transform)

Parameters

transform Transform<TResult>
The record implementing Dispatch<TResult>(Transform<TResult>) to update Whim's state.

Returns

Result<TResult>
The result of the transformation.

Type Parameters

TResult
The result from the transform, if it's successful.

Examples

If you want to get the full result and handle it appropriately:
Result<Guid> firstWorkspace = context.Store.Dispatch(new AddWorkspaceTransform("First Workspace"));
If you want to assume the result is successful and get the value (this will throw an exception if it fails):
Guid firstWorkspace = context.Store.Dispatch(new AddWorkspaceTransform("First Workspace")).Value;

Initialize()

Initialize the event listeners.
void Initialize()

Pick<TResult>(Picker<TResult>)

Entry-point to pick from Whim's state.
TResult Pick<TResult>(Picker<TResult> picker)

Parameters

picker Picker<TResult>
The record implementing Picker<TResult> to fetch from Whim's state.

Returns

TResult
The result of the picker applied to Whim's state.

Type Parameters

TResult
The type of the resulting data from the store.

Examples

If you want to get the full result and handle it appropriately:
Result<IMonitor> monitor = context.Store.Pick(PickMonitorAtPoint(new Point<int>(100, 200)));
If you want to assume the result is successful and get the value (this will throw an exception if it fails):
IMonitor monitor = context.Store.Pick(PickMonitorAtPoint(new Point<int>(100, 200))).Value;

Pick<TResult>(PurePicker<TResult>)

Entry-point to pick from Whim's state.
TResult Pick<TResult>(PurePicker<TResult> picker)

Parameters

picker PurePicker<TResult>
Pure picker to fetch from Whim's state.

Returns

TResult
The result of the picker applied to Whim's state.

Type Parameters

TResult
The type of the resulting data from the store.

Examples

If you want to get the full result and handle it appropriately:
Result<IWorkspace> workspace = context.Store.Pick(PickWorkspaceByWindow(window.Handle));
If you want to assume the result is successful and get the value (this will throw an exception if it fails):
IWorkspace workspace = context.Store.Pick(PickWorkspaceByWindow(window.Handle)).Value;