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
getWindowTitleFunc<string>Function to get the window title (for logging purposes)
logServiceILogServiceOptional log service for diagnostic logging
invalidateCallbackActionCallback to invalidate the window when controls change
invalidateLayoutCallbackActionCallback 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
controlsList<IWindowControl>The control list to add to
interactiveControlsList<IInteractiveControl>The interactive control list to add to
controlIWindowControlThe control to add
containerIContainerThe 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
controlsList<IWindowControl>The control list to clear
interactiveControlsList<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
controlsList<IWindowControl>The control list to remove from
interactiveControlsList<IInteractiveControl>The interactive control list to remove from
controlIWindowControlThe control to remove
Returns
- bool
True if the control was removed; false if it wasn't found