Class WindowQueryHelper
- Namespace
- SharpConsoleUI.Windows
- Assembly
- SharpConsoleUI.dll
Provides static helper methods for querying and finding windows. Extracted from ConsoleWindowSystem as part of Phase 3.3 refactoring.
public static class WindowQueryHelper
- Inheritance
-
WindowQueryHelper
- Inherited Members
Methods
FindDeepestModalChild(Window, ConsoleWindowSystem)
Finds the deepest modal child window with the highest Z-index.
public static Window? FindDeepestModalChild(Window window, ConsoleWindowSystem context)
Parameters
windowWindowThe parent window to search for modal children.
contextConsoleWindowSystemThe window system context.
Returns
- Window
The deepest modal child, or null if none found.
FindWindowToActivate(Window, ConsoleWindowSystem, Action<Window>)
Finds the appropriate window to activate based on modality rules. Handles active modal children and recursive modal hierarchies.
public static Window FindWindowToActivate(Window targetWindow, ConsoleWindowSystem context, Action<Window> flashWindow)
Parameters
targetWindowWindowThe window to activate.
contextConsoleWindowSystemThe window system context.
flashWindowAction<Window>Action to flash a window for user feedback.
Returns
- Window
The window that should actually be activated.
GetWindowAtPoint(Point, ConsoleWindowSystem)
Finds the topmost window at the specified point. Considers parent-child relationships to avoid returning windows covered by their modal children.
public static Window? GetWindowAtPoint(Point point, ConsoleWindowSystem context)
Parameters
pointPointThe point in absolute screen coordinates.
contextConsoleWindowSystemThe window system context.
Returns
- Window
The topmost window at the point, or null if none found.
IsChildWindow(Window, Window)
Checks if a window is a child (or descendant) of another window.
public static bool IsChildWindow(Window potentialChild, Window potentialParent)
Parameters
Returns
- bool
True if potentialChild is a descendant of potentialParent; false otherwise.