Skip to content
ConsoleMonster
Class

InspectorView

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

Shows an arbitrary object (POCO, dictionary, PSObject through a member source, JSON on .NET 8) as a record view: scalar members as labelled values through the automatic presenter, nested objects as indented sections, uniform collections as nested tables (columns inferred from the elements), other collections as lists, with +N more, cycle and depth-limit notes. The object is inspected once, when the view is created.

Inheritance

  • object
  • InspectorView

Usage

Explore 8 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.

Accepted by parameters 4

Constructors

InspectorView 2 overloads
public InspectorView(object? value, InspectorOptions? options = null, string? title = null) #

Inspects a value and creates the view.

Parameters

value object? required
The value.
options ConsoleMonster.Data.InspectorOptions? = null optional
Depth, item and column limits, filters and member sources, or null for defaults.
title string? = null optional
The title, or null for the value's type name.
public InspectorView(InspectNode root, string? title = null) #

Creates the view from an inspection tree.

Parameters

root ConsoleMonster.Data.InspectNode required
The inspection root.
title string? = null optional
The title, or null for the root's type name.

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
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 required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public InspectNode Root { get; } #

The inspection root.

public string? Title { get; } #

The title, or null for the root's type name.

public bool ShowHeader { get; set; } #

Whether the title and summary line is shown (default true; nested inspectors turn it off).

public PresentationOptions Presentation { get; set; } #

Culture, clock and time zone for values.

Extension Methods

Presentation 2 overloads
public static InspectorView Presentation(InspectorView inspectorView, PresentationOptions value) #

Sets InspectorView.Presentation: Culture, clock and time zone for values.

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView required
The instance.
value ConsoleMonster.Presenters.PresentationOptions required
The value.

Returns

InspectorView The same instance.

Examples

// C# initializer or property          // C# fluent
inspectorView.Presentation = value;    inspectorView.Presentation(value);
public static InspectorView Presentation(InspectorView inspectorView, Action<PresentationOptions> configure) #

Configures InspectorView.Presentation in place (creating it when not set): Culture, clock and time zone for values.

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView required
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> required
Configures the value.

Returns

InspectorView The same instance.
public static InspectorView ShowHeader(InspectorView inspectorView, bool value = true) #

Sets InspectorView.ShowHeader: Whether the title and summary line is shown (default true; nested inspectors turn it off).

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView required
The instance.
value bool = true optional
The value; true when omitted.

Returns

InspectorView The same instance.

Examples

// C# initializer or property        // C# fluent
inspectorView.ShowHeader = value;    inspectorView.ShowHeader(value);