Table of Contents

Class WindowPositioningManager

Namespace
SharpConsoleUI.Windows
Assembly
SharpConsoleUI.dll

Manages window positioning and resizing operations. Handles window movement, resizing, bounds validation, and desktop clearing. Extracted from ConsoleWindowSystem as part of Phase 2.2 refactoring.

public class WindowPositioningManager
Inheritance
WindowPositioningManager
Inherited Members

Constructors

WindowPositioningManager(Renderer, RenderCoordinator, Func<ConsoleWindowSystem>)

Initializes a new instance of the WindowPositioningManager class.

public WindowPositioningManager(Renderer renderer, RenderCoordinator renderCoordinator, Func<ConsoleWindowSystem> getWindowSystem)

Parameters

renderer Renderer

Renderer for desktop clearing and region rendering.

renderCoordinator RenderCoordinator

Render coordinator for pending desktop clears.

getWindowSystem Func<ConsoleWindowSystem>

Function to get window system context (lazy to avoid circular dependency).

Methods

MoveOrResizeOperation(Window?, WindowTopologyAction, Direction)

Performs a move or resize operation with desktop clearing and window invalidation. Used for keyboard-based window operations. Uses the same queued rendering approach as mouse drag for consistency.

public void MoveOrResizeOperation(Window? window, WindowTopologyAction windowTopologyAction, Direction direction)

Parameters

window Window

The window to move or resize.

windowTopologyAction WindowTopologyAction

The type of operation (Move or Resize).

direction Direction

The direction of the operation.

MoveWindowBy(Window, int, int)

Moves a window by a relative delta.

public void MoveWindowBy(Window window, int deltaX, int deltaY)

Parameters

window Window

The window to move.

deltaX int

The horizontal movement delta.

deltaY int

The vertical movement delta.

MoveWindowTo(Window, int, int)

Moves a window to a specific position.

public void MoveWindowTo(Window window, int newLeft, int newTop)

Parameters

window Window

The window to move.

newLeft int

The new left coordinate.

newTop int

The new top coordinate.

ResizeWindowBy(Window, int, int)

Resizes a window by a relative delta.

public void ResizeWindowBy(Window window, int deltaWidth, int deltaHeight)

Parameters

window Window

The window to resize.

deltaWidth int

The width change delta.

deltaHeight int

The height change delta.

ResizeWindowTo(Window, int, int, int, int)

Resizes a window to a new size and position.

public void ResizeWindowTo(Window window, int newLeft, int newTop, int newWidth, int newHeight)

Parameters

window Window

The window to resize.

newLeft int

The new left coordinate.

newTop int

The new top coordinate.

newWidth int

The new width.

newHeight int

The new height.