Table of Contents

Class WindowSystemState

Namespace
SharpConsoleUI.Core
Assembly
SharpConsoleUI.dll

Immutable snapshot of the entire window system state. Provides a single source of truth for window management.

public record WindowSystemState : IEquatable<WindowSystemState>
Inheritance
WindowSystemState
Implements
Inherited Members

Fields

Empty

Empty initial state

public static readonly WindowSystemState Empty

Field Value

WindowSystemState

Properties

ActiveWindow

The currently active window (receives keyboard input)

public Window? ActiveWindow { get; init; }

Property Value

Window

Interaction

Current mouse interaction state (drag/resize)

public InteractionState Interaction { get; init; }

Property Value

InteractionState

UpdateTime

Timestamp when this state was created

public DateTime UpdateTime { get; init; }

Property Value

DateTime

WindowCount

Gets the number of registered windows

public int WindowCount { get; }

Property Value

int

Windows

All registered windows indexed by their GUID

public IReadOnlyDictionary<string, Window> Windows { get; init; }

Property Value

IReadOnlyDictionary<string, Window>

Methods

GetMaxZIndex()

Gets the maximum Z-index among all windows

public int GetMaxZIndex()

Returns

int

GetVisibleWindows()

Gets only visible windows (excludes minimized)

public IReadOnlyList<Window> GetVisibleWindows()

Returns

IReadOnlyList<Window>

GetWindowsByZOrder()

Gets windows ordered by Z-index (back to front)

public IReadOnlyList<Window> GetWindowsByZOrder()

Returns

IReadOnlyList<Window>

HasActiveWindowChanged(WindowSystemState)

Checks if active window has changed compared to another state

public bool HasActiveWindowChanged(WindowSystemState other)

Parameters

other WindowSystemState

Returns

bool

HasInteractionChanged(WindowSystemState)

Checks if interaction state has changed compared to another state

public bool HasInteractionChanged(WindowSystemState other)

Parameters

other WindowSystemState

Returns

bool

HasWindowsChanged(WindowSystemState)

Checks if window collection has changed compared to another state

public bool HasWindowsChanged(WindowSystemState other)

Parameters

other WindowSystemState

Returns

bool