DefaultValueDisplay<T>

public sealed class DefaultValueDisplay<T> : IValueDisplay
Gets the default display proxy for data. The default display assumes the existence of a primary and optional secondary textual description of a value.
T

Constructors

DefaultValueDisplay

#
public DefaultValueDisplay(Pear<T> pear, LazyStrings description)
Create a new proxy with custom texts.
pear (Pear<T>)
description (LazyStrings)

DefaultValueDisplay

#
public DefaultValueDisplay(Pear<T> pear, string primary, string secondary = null)
Create a new proxy with custom texts.
pear (Pear<T>)
primary (string)
secondary (string = null)

DefaultValueDisplay

#
public DefaultValueDisplay(Pear<T> pear)
Create a new proxy from a value pear.
pear (Pear<T>)

Properties

Description

#
public LazyStrings Description { get; }
Primary text to display (big and opaque).

Height

#
public DisplayHeight Height { get; }
Gets the ideal vertical height for this proxy. There is no guarantee this hint will be obeyed, when proxies are part of a table, the highest element in each row will set the height of all elements.
Height

Value

#
public Pear<T> Value { get; }
Value this proxy wraps around.

Methods

AddDetail

#
public void AddDetail(int start, string fragment, string detail)
Register a detailed description for a fragment of the primary description. The fragment must occur verbatim in the primary string at the given index, otherwise the detail is ignored. To describe the entire value, register the whole primary string as the fragment.
start (int)Index of the first fragment character within the primary description.
fragment (string)Fragment of the primary description which is described in more detail.
detail (string)Detailed description.
Explicit

IValueDisplay.Draw

#
void IValueDisplay.Draw(Context context, Font font, Color background, ValueDisplayFrame frame)
context (Context)
font (Font)
background (Color)
frame (ValueDisplayFrame)
Draw