API Reference
RecordView
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 31 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 19
- Extension method RecordView.WithHideEmpty
- Extension method RecordView.WithIndentWidth
- Extension method RecordView.WithMaxLabelFraction
- Extension method RecordView.WithPresentation
- Extension method RecordView.WithSummary
- Extension method RecordView.WithTitle
- Method RecordView.AddField
- Method RecordView.AddFieldAt
- Method RecordView.AddGroup
- Method RecordView.AddHeading
- Method RecordView.AddSection
- Method RecordView.AddWidget
- Method RecordView.AddWidgetAt
- Method RecordViewFluent.WithHideEmpty
- Method RecordViewFluent.WithIndentWidth
- Method RecordViewFluent.WithMaxLabelFraction
- Method RecordViewFluent.WithPresentation
- Method RecordViewFluent.WithSummary
- Method RecordViewFluent.WithTitle
Accepted by parameters 12
- Extension method RecordView.WithHideEmpty
- Extension method RecordView.WithIndentWidth
- Extension method RecordView.WithMaxLabelFraction
- Extension method RecordView.WithPresentation
- Extension method RecordView.WithSummary
- Extension method RecordView.WithTitle
- Method RecordViewFluent.WithHideEmpty
- Method RecordViewFluent.WithIndentWidth
- Method RecordViewFluent.WithMaxLabelFraction
- Method RecordViewFluent.WithPresentation
- Method RecordViewFluent.WithSummary
- Method RecordViewFluent.WithTitle
Constructors
public RecordView(String? title = null) #Creates a record view.
Parameters
- title System.String? = null
- The title (markup) shown on the summary header line, or null.
Methods
public RecordView AddField(String label, Object? value, ICellPresenter? presenter = null, IReadOnlyList<ToneRule>? rules = null) #RecordViewAdds a field with a raw value, formatted by a presenter.
Parameters
- label System.String
- The label (plain text).
- value System.Object?
- The value.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null for automatic.
- rules System.Collections.Generic.IReadOnlyList<ConsoleMonster.Presenters.ToneRule>? = null
- Tone rules, or null.
Returns
This instance.
public RecordView AddField(String label, TableCell cell, ICellPresenter? presenter = null, IReadOnlyList<ToneRule>? rules = null) #RecordViewAdds a field with a cell (markup, status or raw value).
Parameters
- label System.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.ToneRule>? = null
- Tone rules, or null.
Returns
This instance.
public RecordView AddFieldAt(Int32 level, String label, TableCell cell, ICellPresenter? presenter = null) #RecordViewAdds a field at an explicit level (used by the object inspector for nested members).
Parameters
- level System.Int32
- The level.
- label System.String
- The label.
- cell ConsoleMonster.Widgets.TableCell
- The cell.
- presenter ConsoleMonster.Presenters.ICellPresenter? = null
- The presenter, or null.
Returns
This instance.
public RecordView AddGroup(String title, String? note = null) #RecordViewAdds a group heading under the current section; following fields belong to it.
Parameters
- title System.String
- The heading (markup).
- note System.String? = null
- An optional muted note, or null.
Returns
This instance.
public RecordView AddHeading(String title, Int32 level, ThemeToken? tone = null, String? note = null) #RecordViewAdds a heading at a nesting level (0 = section, 1 = group, deeper for nested objects).
Parameters
- title System.String
- The heading (markup).
- level System.Int32
- The level.
- tone ConsoleMonster.Styling.ThemeToken? = null
- An optional tone, or null.
- note System.String? = null
- An optional muted note, or null.
Returns
This instance.
public RecordView AddSection(String title, ThemeToken? tone = null, String? note = null) #RecordViewAdds a top-level section heading; following fields belong to it.
Parameters
- title System.String
- The heading (markup).
- tone ConsoleMonster.Styling.ThemeToken? = null
- An optional tone (for example the record's status), or null.
- note System.String? = null
- An optional muted note after the heading, or null.
Returns
This instance.
public RecordView AddWidget(IWidget widget) #RecordViewAdds a nested widget (a table, a list) under the current heading.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget.
Returns
This instance.
public RecordView AddWidgetAt(Int32 level, IWidget widget) #RecordViewAdds a nested widget at an explicit level.
Parameters
- level System.Int32
- The level.
- widget ConsoleMonster.Layout.IWidget
- The widget.
Returns
This instance.
public Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #VoidRenders 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.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
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 Boolean HideEmpty { get; set; } #Whether empty values (null, empty text) are left out (default true).
public Int32 IndentWidth { get; set; } #Cells each nesting level indents (default 2).
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 WithHideEmpty(RecordView recordView, Boolean value = true) #RecordViewSets RecordView.HideEmpty: Whether empty values (null, empty text) are left out (default true).
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static RecordView WithIndentWidth(RecordView recordView, Int32 value) #RecordViewSets RecordView.IndentWidth: Cells each nesting level indents (default 2).
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static RecordView WithMaxLabelFraction(RecordView recordView, Double value) #RecordViewSets 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 System.Double
- The value.
Returns
The same instance.
public static RecordView WithPresentation(RecordView recordView, PresentationOptions value) #RecordViewSets RecordView.Presentation: Culture, clock and time zone for raw values.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value ConsoleMonster.Presenters.PresentationOptions
- The value.
Returns
The same instance.
public static RecordView WithPresentation(RecordView recordView, Action<PresentationOptions> configure) #RecordViewConfigures 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.
Returns
The same instance.
public static RecordView WithSummary(RecordView recordView, String? value) #RecordViewSets RecordView.Summary: A muted summary after the title (12 targets · 4 failing), or null.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static RecordView WithTitle(RecordView recordView, String? value) #RecordViewSets RecordView.Title: The title (markup) on the summary header line, or null.
Parameters
- recordView ConsoleMonster.Widgets.RecordView
- The instance.
- value System.String?
- The value.
Returns
The same instance.