Skip to content
ConsoleMonster
Class

KeyValueItem

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

One pair in a KeyValueList.

Inheritance

  • object
  • KeyValueItem

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 2

Accepted by parameters 1

Constructors

public KeyValueItem(string key, string value, StatusKind? status = null) #

Creates a pair.

Parameters

key string required
The key (plain text).
value string required
The value (markup).
status ConsoleMonster.Styling.StatusKind? = null optional
An optional status marker.

Methods

public static KeyValueItem ForValue(string key, object? value, ICellPresenter? presenter = null, StatusKind? status = null) #

Creates a pair whose value is formatted by a presenter (sizes, durations, dates, statuses...).

Parameters

key string required
The key (plain text).
value object? required
The raw value.
presenter ConsoleMonster.Presenters.ICellPresenter? = null optional
The presenter, or null for the one the key and value suggest.
status ConsoleMonster.Styling.StatusKind? = null optional
An optional status marker.

Returns

KeyValueItem The pair, for KeyValueList.Add.

Properties

public string Key { get; } #

The key.

public string Value { get; } #

The value (markup).

public StatusKind? Status { get; } #

An optional status marker.

public TableCell? Cell { get; internal set; } #

A raw value shown through KeyValueItem.Presenter instead of KeyValueItem.Value, or null.

public ICellPresenter? Presenter { get; internal set; } #

The presenter for KeyValueItem.Cell, or null for automatic.

public IReadOnlyList<RoleRule>? Rules { get; internal set; } #

Tone rules for KeyValueItem.Cell, or null.