RecordView
ConsoleMonster.Widgets
One record (or a few) as a readable sheet: a summary header line, sections and groups, aligned label/value fields that hide when empty, and nested widgets such as tables. It is the console counterpart of a record drawer, the fallback a table uses for a single row, the layout of record cards, and the view of the object inspector.
Inheritance
- object
- RecordView
Usage
Explore 33 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 21
- Method ConsoleView.BuildList
- Extension method RecordView.HideEmpty
- Extension method RecordView.IndentWidth
- Extension method RecordView.MaxLabelFraction
- Extension method RecordView.Presentation
- Extension method RecordView.Summary
- Extension method RecordView.Title
- Method RecordView.Field
- Method RecordView.FieldAt
- Method RecordView.Field``1
- Method RecordView.Group
- Method RecordView.Heading
- Method RecordView.Section
- Method RecordView.Widget
- Method RecordView.WidgetAt
- Method RecordViewFluent.HideEmpty
- Method RecordViewFluent.IndentWidth
- Method RecordViewFluent.MaxLabelFraction
- Method RecordViewFluent.Presentation
- Method RecordViewFluent.Summary
- Method RecordViewFluent.Title
Accepted by parameters 12
- Extension method RecordView.HideEmpty
- Extension method RecordView.IndentWidth
- Extension method RecordView.MaxLabelFraction
- Extension method RecordView.Presentation
- Extension method RecordView.Summary
- Extension method RecordView.Title
- Method RecordViewFluent.HideEmpty
- Method RecordViewFluent.IndentWidth
- Method RecordViewFluent.MaxLabelFraction
- Method RecordViewFluent.Presentation
- Method RecordViewFluent.Summary
- Method RecordViewFluent.Title
Constructors
public RecordView(string? title = null) #Creates a record view.
Parameters
- title string? = null
- The title (markup) shown on the summary header line, or null.
Methods
public RecordView Field(string label, object? value, ICellPresenter? presenter = null, IReadOnlyList<RoleRule>? rules = null) #Adds a field with a raw value, formatted by a presenter.
Parameters
- label string
- The label (plain text).
- value object?
- The value.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null for automatic.
- rules System.Collections.Generic.IReadOnlyList<ConsoleMonster.Presenters.RoleRule>? = null
- Role rules, or null.
public RecordView Field(string label, TableCell cell, ICellPresenter? presenter = null, IReadOnlyList<RoleRule>? rules = null) #Adds a field with a cell (markup, status or raw value).
Parameters
- label string
- The label (plain text).
- cell ConsoleMonster.Widgets.TableCell
- The cell.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter for raw values, or null for automatic.
- rules System.Collections.Generic.IReadOnlyList<ConsoleMonster.Presenters.RoleRule>? = null
- Role rules, or null.
public RecordView FieldAt(int level, string label, TableCell cell, ICellPresenter? presenter = null) #Adds a field at an explicit level (used by the object inspector for nested members).
Parameters
- level int
- The level.
- label string
- The label.
- cell ConsoleMonster.Widgets.TableCell
- The cell.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null.
public RecordView Field<T>(string label, T? value, ICellPresenter? presenter = null, IReadOnlyList<RoleRule>? rules = null) #Adds a strongly typed raw value, preserving literal strings instead of implicitly converting them to markup cells.
Type Parameters
- T
- The value type.
Parameters
- label string
- The label (plain text).
- value T?
- The raw value.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null for automatic.
- rules System.Collections.Generic.IReadOnlyList<ConsoleMonster.Presenters.RoleRule>? = null
- Role rules, or null.
public RecordView Group(string title, string? note = null) #Adds a group heading under the current section; following fields belong to it.
Parameters
- title string
- The heading (markup).
- note string? = null
- An optional muted note, or null.
public RecordView Heading(string title, int level, ThemeToken? role = null, string? note = null) #Adds a heading at a nesting level (0 = section, 1 = group, deeper for nested objects).
Parameters
- title string
- The heading (markup).
- level int
- The level.
- role ConsoleMonster.Styling.ThemeToken? = null
- An optional tone, or null.
- note string? = null
- An optional muted note, or null.
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public RecordView Section(string title, ThemeToken? role = null, string? note = null) #Adds a top-level section heading; following fields belong to it.
Parameters
- title string
- The heading (markup).
- role ConsoleMonster.Styling.ThemeToken? = null
- An optional tone (for example the record's status), or null.
- note string? = null
- An optional muted note after the heading, or null.
public RecordView Widget(IWidget widget) #Adds a nested widget (a table, a list) under the current heading.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget.
public RecordView WidgetAt(int level, IWidget widget) #Adds a nested widget at an explicit level.
Parameters
- level int
- The level.
- widget ConsoleMonster.Layout.IWidget
- The widget.
Inherited Methods
Properties
public IReadOnlyList<IWidget> Children { get; } #Embedded widgets, including value fields, for live discovery and recording replay.
public string? Title { get; set; } #The title (markup) on the summary header line, or null.
public string? Summary { get; set; } #A muted summary after the title (12 targets · 4 failing), or null.
public bool HideEmpty { get; set; } #Whether null, empty and missing values are left out (default true).
public double MaxLabelFraction { get; set; } #The widest a label column may be, as a fraction of the width (default 0.4).
public PresentationOptions Presentation { get; set; } #Culture, clock and time zone for raw values.
Extension Methods
public static RecordView HideEmpty(RecordView recordView, bool value = true) #Sets RecordView.HideEmpty: Whether null, empty and missing values are left out (default true).
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { HideEmpty = value }; recordView.HideEmpty(value);public static RecordView IndentWidth(RecordView recordView, int value) #Sets RecordView.IndentWidth: Cells each nesting level indents (default 2).
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { IndentWidth = value }; recordView.IndentWidth(value);public static RecordView MaxLabelFraction(RecordView recordView, double value) #Sets RecordView.MaxLabelFraction: The widest a label column may be, as a fraction of the width (default 0.4).
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value double
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { MaxLabelFraction = value }; recordView.MaxLabelFraction(value);public static RecordView Presentation(RecordView recordView, PresentationOptions value) #Sets RecordView.Presentation: Culture, clock and time zone for raw values.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value ConsoleMonster.Presenters.PresentationOptions
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { Presentation = value }; recordView.Presentation(value);public static RecordView Presentation(RecordView recordView, Action<PresentationOptions> configure) #Configures RecordView.Presentation in place (creating it when not set): Culture, clock and time zone for raw values.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- configure System.Action<ConsoleMonster.Presenters.PresentationOptions>
- Configures the value.
public static RecordView Summary(RecordView recordView, string? value) #Sets RecordView.Summary: A muted summary after the title (12 targets · 4 failing), or null.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { Summary = value }; recordView.Summary(value);public static RecordView Title(RecordView recordView, string? value) #Sets RecordView.Title: The title (markup) on the summary header line, or null.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.RecordView { Title = value }; recordView.Title(value);