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
rendererRendererRenderer for desktop clearing and region rendering.
renderCoordinatorRenderCoordinatorRender coordinator for pending desktop clears.
getWindowSystemFunc<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
windowWindowThe window to move or resize.
windowTopologyActionWindowTopologyActionThe type of operation (Move or Resize).
directionDirectionThe 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
windowWindowThe window to move.
deltaXintThe horizontal movement delta.
deltaYintThe vertical movement delta.
MoveWindowTo(Window, int, int)
Moves a window to a specific position.
public void MoveWindowTo(Window window, int newLeft, int newTop)
Parameters
windowWindowThe window to move.
newLeftintThe new left coordinate.
newTopintThe new top coordinate.
ResizeWindowBy(Window, int, int)
Resizes a window by a relative delta.
public void ResizeWindowBy(Window window, int deltaWidth, int deltaHeight)
Parameters
windowWindowThe window to resize.
deltaWidthintThe width change delta.
deltaHeightintThe 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)