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
Properties
ActiveWindow
The currently active window (receives keyboard input)
public Window? ActiveWindow { get; init; }
Property Value
Interaction
Current mouse interaction state (drag/resize)
public InteractionState Interaction { get; init; }
Property Value
UpdateTime
Timestamp when this state was created
public DateTime UpdateTime { get; init; }
Property Value
WindowCount
Gets the number of registered windows
public int WindowCount { get; }
Property Value
Windows
All registered windows indexed by their GUID
public IReadOnlyDictionary<string, Window> Windows { get; init; }
Property Value
Methods
GetMaxZIndex()
Gets the maximum Z-index among all windows
public int GetMaxZIndex()
Returns
GetVisibleWindows()
Gets only visible windows (excludes minimized)
public IReadOnlyList<Window> GetVisibleWindows()
Returns
GetWindowsByZOrder()
Gets windows ordered by Z-index (back to front)
public IReadOnlyList<Window> GetWindowsByZOrder()
Returns
HasActiveWindowChanged(WindowSystemState)
Checks if active window has changed compared to another state
public bool HasActiveWindowChanged(WindowSystemState other)
Parameters
otherWindowSystemState
Returns
HasInteractionChanged(WindowSystemState)
Checks if interaction state has changed compared to another state
public bool HasInteractionChanged(WindowSystemState other)
Parameters
otherWindowSystemState
Returns
HasWindowsChanged(WindowSystemState)
Checks if window collection has changed compared to another state
public bool HasWindowsChanged(WindowSystemState other)
Parameters
otherWindowSystemState