Skip to content
ConsoleMonster
Class

LinkPresenter

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Implements
ICellPresenter
Modifiers
sealed

A URL or filesystem path: clickable (OSC 8) where the terminal profile permits it, 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<object?, string>? = null optional
Picks the shown text from the value, or null to show the address.
address System.Func<object?, string>? = null optional
Picks the address from the value, or null to use the value itself.

Methods

public PresentedValue Present(object? value, PresenterContext context) #

Presents a value.

Parameters

value object? required
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext required
Culture, clock, time zone, column statistics and the render context.

Returns

PresentedValue 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.