Skip to content
ConsoleMonster

API Reference

Class

LinkPresenter

Namespace ConsoleMonster.Presenters
Assembly ConsoleMonster
Implements
Modifiers sealed

A hyperlink: clickable (OSC 8) in Windows Terminal and VS Code, plain text elsewhere. When the shown text differs from the address and the terminal cannot link, the address follows in brackets so nothing is lost in logs.

Inheritance

  • Object
  • LinkPresenter

Constructors

public LinkPresenter(Func<Object?, String>? text = null, Func<Object?, String>? address = null) #

Creates a link presenter.

Parameters

text System.Func<System.Object?, System.String>? = null optionalposition: 0
Picks the shown text from the value, or null to show the address.
address System.Func<System.Object?, System.String>? = null optionalposition: 1
Picks the address from the value, or null to use the value itself.

Methods

public PresentedValue Present(Object? value, PresenterContext context) #
Returns: PresentedValue

Presents a value.

Parameters

value System.Object? requiredposition: 0
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext requiredposition: 1
Culture, clock, time zone, column statistics and the render context.

Returns

The presented value.

Properties

public Func<Object?, String>? TextSelector { get; } #

Picks the shown text, or null.

public Func<Object?, String>? AddressSelector { get; } #

Picks the address, or null.