Skip to content
ConsoleMonster

API Reference

Class

InspectorView

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
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 System.Object? requiredposition: 0
The value.
options ConsoleMonster.Data.InspectorOptions? = null optionalposition: 1
Depth, item and column limits, filters and member sources, or null for defaults.
title System.String? = null optionalposition: 2
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 requiredposition: 0
The inspection root.
title System.String? = null optionalposition: 1
The title, or null for the root's type name.

Methods

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
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 Boolean 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

WithPresentation 2 overloads
public static InspectorView WithPresentation(InspectorView inspectorView, PresentationOptions value) #
Returns: InspectorView

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

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView requiredposition: 0
The instance.
value ConsoleMonster.Presenters.PresentationOptions requiredposition: 1
The value.

Returns

The same instance.

public static InspectorView WithPresentation(InspectorView inspectorView, Action<PresentationOptions> configure) #
Returns: InspectorView

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

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView requiredposition: 0
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> requiredposition: 1
Configures the value.

Returns

The same instance.

public static InspectorView WithShowHeader(InspectorView inspectorView, Boolean value = true) #
Returns: InspectorView

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

Parameters

inspectorView ConsoleMonster.Widgets.InspectorView requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.