Table of Contents

Namespace SharpConsoleUI.Core

Classes

ActivationBlockedEventArgs

Event arguments for activation blocked events

AsyncEvent

Raises a paired sync/async notification event. Sync subscribers run inline; async subscribers are fire-and-forgotten (their continuations marshal back via the installed UI SynchronizationContext) and their exceptions are routed to the log instead of being thrown or going unobserved.

ButtonColorSet

Immutable record representing a color set for a button control.

CursorState

Immutable record representing the current state of the cursor. Provides a single source of truth for cursor visibility, position, and ownership.

CursorStateChangedEventArgs

Event arguments for cursor state changes

CursorStateService

Centralized service for managing cursor state across the window system. Provides a single source of truth for cursor visibility, position, and ownership.

DesktopBackgroundService

Core service that owns a cached CharacterBuffer and renders the desktop background into it. The main render loop blits from this cache instead of flat-filling. Renders three composable layers: base fill (from theme) -> gradient overlay -> pattern overlay. For animated backgrounds, a PaintCallback takes full control and is driven by a timer.

DesktopPortal

A desktop-level portal that renders above all windows. Portals are lightweight render overlays managed by DesktopPortalService.

DesktopPortalOptions

Options for creating a desktop portal.

DesktopPortalService

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.

DisposableManager

Manager for tracking and disposing resources in a coordinated manner

DisposableManagerExtensions

Extension methods for easier resource management

DisposalScope

A disposal scope that can register resources for disposal when the scope is disposed

DragState

State of an active drag operation

EditOperation

Represents an undoable edit operation

EditState

Immutable record representing the edit state of a text control

EditStateChangedEventArgs

Event arguments for edit state changes

FocusChangedEventArgs

Event args for FocusChanged.

FocusManager

Manages focus within a single Window. This is the single source of truth for which control has focus. Use SetFocus(IFocusableControl?, FocusReason) to move focus programmatically, MoveFocus(bool) to advance via Tab, and HandleClick(IWindowControl?) to focus via mouse.

IdleStateEventArgs

Event arguments for idle state changes

InputStateService

Centralized service for managing input state. Provides input queue management, modifier tracking, and input history.

InteractionState

Current mouse interaction state (drag or resize operation)

InteractionStateChangedEventArgs

Event arguments for interaction (drag/resize) state changes

KeyPressEventArgs

Event arguments for key press events

LayoutAllocation

Represents the allocated space for a control after layout calculation

LayoutRequirements

Controls express sizing and alignment needs via this record. Single source of truth for all layout-related information.

LayoutState

Complete layout state for a control, tracking requirements, allocation, and actual dimensions

ModalState

Immutable record representing the current modal state. Tracks modal window stack and parent-child relationships.

ModalStateChangedEventArgs

Event arguments for modal state changes

ModalStateService

Centralized service for managing modal window state. Handles modal window stack, parent-child relationships, and activation blocking.

NotificationEventArgs

Event arguments for notification state changes.

NotificationInfo

Represents the state of a single notification.

NotificationSeverity

Represents a notification severity level with associated visual properties such as colors and icons. Uses single-cell-width Unicode characters for reliable console rendering.

NotificationState

Represents the current notification system state.

NotificationStateService

Centralized service for managing notification state. Tracks active notifications, provides dismissal methods, and fires events.

PanelStateService

Manages panel state and visibility.

PluginEventArgs

Event arguments for plugin load/unload events.

PluginState

Immutable record representing the current state of the plugin system.

PluginStateChangedEventArgs

Event arguments for plugin state changes.

PluginStateService

Service that manages the plugin system state, including plugin loading, service registration, and factory management. This service follows the established manager pattern for state management.

RecoveredEventArgs

Raised on the UI thread when the main loop recovers after a stall. Safe to touch the UI.

RegistryStateService

Integrates AppRegistry with the ConsoleWindowSystem lifecycle. Calls Load() during initialization and Save() on Dispose() (shutdown). Exposes all AppRegistry members via explicit delegation so callers don't need to unwrap an inner object.

ResizeState

State of an active resize operation

ScrollChangedEventArgs

Event arguments for scroll changes

ScrollState

Immutable record representing scroll state for a scrollable element

SelectionChangedEventArgs

Event payload describing a change to a window's active text selection.

SelectionManager

Manages text selection within a single Window. This is the single source of truth for which ISelectableControl owns the active selection. Only one control may have a selection at a time: SetActiveSelection(ISelectableControl) clears the previously active control's selection before adopting the new one. Mirrors the per-window FocusManager.

ServiceRegisteredEventArgs

Event arguments for service registration events.

ServiceUnregisteredEventArgs

Event arguments for service unregistration events.

SettingsGroupBuilder

Builder for configuring pages within a settings group during registration.

SettingsGroupRegistration

Registration for a settings group containing one or more pages.

SettingsPageRegistration

Registration for a single settings page within a group.

SettingsRegistrationService

Stores custom settings group and page registrations for the Settings dialog.

TaskToastScheduler

Default IToastScheduler that delays via Delay(int) and marshals the callback back to the UI thread.

TextChangedEventArgs

Event arguments for text changes

TextPosition

Represents a text position (line and column).

TextSelection

Represents a text selection (start and end positions)

ThemeChangedEventArgs

Event arguments for theme changes

ThemeRegistryStateService

Per-ConsoleWindowSystem registry of available themes. Registration, lookup, and enumeration are scoped to the owning window system, so themes registered (including those contributed by a loaded plugin) never leak across instances. Pre-seeded with the built-in ModernGray theme plus the palette-generated seed catalog. Thread-safe.

ThemeStateService

Centralized service for managing theme state. Provides change notifications when theme is updated.

ToastEventArgs

Event data describing a toast state transition.

ToastInfo

Immutable description of a single active toast.

ToastOptions

Optional per-toast configuration overriding service defaults.

ToastService

Manages transient toast notifications: showing, auto-dismissing, and stacking.

ToastState

Immutable snapshot of the toast subsystem state.

UnresponsiveEventArgs

Raised when the main loop has not heartbeat past the unresponsive threshold. IMPORTANT: raised on the watchdog timer thread (the UI thread is stuck). Handlers must be thread-safe and must NOT touch the UI — log, set a flag, or write raw ANSI only.

WindowActivatedEventArgs

Event arguments for window activation changes

WindowColorSet

Immutable record representing a color set for a window.

WindowEventArgs

Event arguments for individual window events

WindowStateEventArgs

Event arguments for window state (minimize/maximize/restore) changes

WindowStateService

Centralized service for managing window system state. Provides a single source of truth for window collection, active window, and interaction state (drag/resize operations).

WindowSystemState

Immutable snapshot of the entire window system state. Provides a single source of truth for window management.

WindowSystemStateChangedEventArgs

Event arguments for window system state changes. Provides both previous and new state for comparison.

Interfaces

ICursorBlinkProvider

Interface for controls that can specify a preferred cursor blink behavior. Controls implementing this interface can customize whether the cursor blinks when focused.

ICursorShapeProvider

Interface for controls that can specify a preferred cursor shape. Controls implementing this interface can customize how the cursor appears when focused.

IToastScheduler

Abstraction for scheduling a delayed callback used to auto-dismiss toasts.

Enums

CursorBlink

Controls hardware-cursor blinking via DECSCUSR. The terminal owns the blink rate; only blinking-vs-steady (and the terminal default) can be selected.

CursorShape

Represents the shape/style of the cursor

EditChangeReason

Reason for an edit state change

EditOperationType

Types of edit operations for undo/redo

LayoutChangeReason

Reason for a layout change.

MainLoopPhase

Identifies which step of the main loop was executing — surfaced in UnresponsiveEventArgs to attribute a stall to input handling, UI-action draining, rendering, or idle wait.

NotificationSeverityEnum

Specifies the severity level for notifications.

ScrollChangeReason

Reason for a scroll change

ToastPosition

Specifies where a toast notification is anchored on the screen.

WindowEventType

Types of window events

Delegates

AsyncEventHandler<TArgs>

Async counterpart of EventHandler<TEventArgs> for user-facing notification events.