Table of Contents

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

logService ILogService

Service for debug logging.

windowSystem ConsoleWindowSystem

The window system this service belongs to.

Properties

HasPortals

Gets whether any desktop portals are currently open.

public bool HasPortals { get; }

Property Value

bool

Portals

Gets a read-only list of all open portals, ordered by ZOrder.

public IReadOnlyList<DesktopPortal> Portals { get; }

Property Value

IReadOnlyList<DesktopPortal>

TopPortal

Gets the topmost portal (highest ZOrder), or null if none.

public DesktopPortal? TopPortal { get; }

Property Value

DesktopPortal

Methods

AnyPortalDirty()

Returns true if any portal needs re-rendering. Checked by the main loop's shouldRender gate.

public bool AnyPortalDirty()

Returns

bool

CreatePortal(DesktopPortalOptions)

Creates and shows a new desktop portal.

public DesktopPortal CreatePortal(DesktopPortalOptions options)

Parameters

options DesktopPortalOptions

Portal 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

point Point

Screen-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

portal DesktopPortal

The portal to remove.