Table of Contents

Class WindowContentManager

Namespace
SharpConsoleUI.Windows
Assembly
SharpConsoleUI.dll

Coordinates window control management operations. Extracted from Window class as part of Phase 3.1 refactoring. Operates on Window's control lists to maintain backward compatibility.

public class WindowContentManager
Inheritance
WindowContentManager
Inherited Members

Constructors

WindowContentManager(Func<string>, ILogService?, Action, Action)

Initializes a new instance of the WindowContentManager class.

public WindowContentManager(Func<string> getWindowTitle, ILogService? logService, Action invalidateCallback, Action invalidateLayoutCallback)

Parameters

getWindowTitle Func<string>

Function to get the window title (for logging purposes)

logService ILogService

Optional log service for diagnostic logging

invalidateCallback Action

Callback to invalidate the window when controls change

invalidateLayoutCallback Action

Callback to invalidate the layout tree when controls change

Methods

AddControl(List<IWindowControl>, List<IInteractiveControl>, IWindowControl, IContainer)

Adds a control to the control list.

public void AddControl(List<IWindowControl> controls, List<IInteractiveControl> interactiveControls, IWindowControl control, IContainer container)

Parameters

controls List<IWindowControl>

The control list to add to

interactiveControls List<IInteractiveControl>

The interactive control list to add to

control IWindowControl

The control to add

container IContainer

The container to set on the control

ClearControls(List<IWindowControl>, List<IInteractiveControl>)

Removes all controls from the control lists.

public void ClearControls(List<IWindowControl> controls, List<IInteractiveControl> interactiveControls)

Parameters

controls List<IWindowControl>

The control list to clear

interactiveControls List<IInteractiveControl>

The interactive control list to clear

RemoveControl(List<IWindowControl>, List<IInteractiveControl>, IWindowControl)

Removes a control from the control list.

public bool RemoveControl(List<IWindowControl> controls, List<IInteractiveControl> interactiveControls, IWindowControl control)

Parameters

controls List<IWindowControl>

The control list to remove from

interactiveControls List<IInteractiveControl>

The interactive control list to remove from

control IWindowControl

The control to remove

Returns

bool

True if the control was removed; false if it wasn't found