Interface ISelectableControl
- Namespace
- SharpConsoleUI.Controls
- Assembly
- SharpConsoleUI.dll
Implemented by controls that expose a mouse-driven text selection coordinated by the owning window's SelectionManager. Only one selectable control may own the active selection per window; starting a selection in one control clears any other. The selected text is always plain text (markup/decorations stripped) suitable for copying.
public interface ISelectableControl : IWindowControl, IDisposable
- Inherited Members
- Extension Methods
Properties
HasSelection
Gets whether this control currently has a non-empty text selection.
bool HasSelection { get; }
Property Value
Methods
ClearSelection()
Clears this control's selection, if any.
void ClearSelection()
GetSelectedText()
Gets the currently selected text as plain text (any markup tags removed). Returns an empty string when nothing is selected.
string GetSelectedText()
Returns
Events
SelectionChanged
Raised when the selection changes. The string payload is the current selected text (empty when the selection was cleared).
event EventHandler<string>? SelectionChanged