Class DesktopPortalService
- Namespace
- SharpConsoleUI.Core
- Assembly
- SharpConsoleUI.dll
Manages desktop-level portals — lightweight render overlays that appear above all windows. Portals render after windows in the normal render pass and never interfere with window rendering.
public class DesktopPortalService
- Inheritance
-
DesktopPortalService
- Inherited Members
- Extension Methods
Constructors
DesktopPortalService(ILogService, ConsoleWindowSystem)
Initializes a new instance of the DesktopPortalService class.
public DesktopPortalService(ILogService logService, ConsoleWindowSystem windowSystem)
Parameters
logServiceILogServiceService for debug logging.
windowSystemConsoleWindowSystemThe window system this service belongs to.
Properties
HasPortals
Gets whether any desktop portals are currently open.
public bool HasPortals { get; }
Property Value
Portals
Gets a read-only list of all open portals, ordered by ZOrder.
public IReadOnlyList<DesktopPortal> Portals { get; }
Property Value
TopPortal
Gets the topmost portal (highest ZOrder), or null if none.
public DesktopPortal? TopPortal { get; }
Property Value
Methods
AnyPortalDirty()
Returns true if any portal needs re-rendering. Checked by the main loop's shouldRender gate.
public bool AnyPortalDirty()
Returns
CreatePortal(DesktopPortalOptions)
Creates and shows a new desktop portal.
public DesktopPortal CreatePortal(DesktopPortalOptions options)
Parameters
optionsDesktopPortalOptionsPortal configuration options.
Returns
- DesktopPortal
The created portal.
DismissAllPortals()
Dismisses all open portals and restores the original active window.
public void DismissAllPortals()
HitTest(Point)
Tests if a screen point hits any portal. Returns the topmost hit portal, or null.
public DesktopPortal? HitTest(Point point)
Parameters
pointPointScreen-space point.
Returns
- DesktopPortal
The topmost portal containing the point, or null.
RemovePortal(DesktopPortal)
Removes a specific portal and cleans up.
public void RemovePortal(DesktopPortal portal)
Parameters
portalDesktopPortalThe portal to remove.