Skip to content
ConsoleMonster

API Reference

Class

ConsoleView

Namespace ConsoleMonster.Views
Assembly ConsoleMonster
Modifiers static

Picks the best view for data and builds it: one object becomes an inspector, objects of one shape a table (cards when narrow), hierarchical objects a tree, a numeric series a chart, strings highlighted code when a language is detected and text otherwise. Columns get presenters from their member names and types (CellPresenters.ForMember). Show-Console is the PowerShell front end.

Inheritance

  • Object
  • ConsoleView

Methods

Auto 2 overloads
public static IWidget Auto(Object? value, ConsoleViewOptions? options = null) #
Returns: IWidget

Builds the automatic view for a value: a sequence is shown as its items, anything else as one item.

Parameters

value System.Object? requiredposition: 0
The value.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The widget.

public static IWidget Auto(IReadOnlyList<Object?> items, ConsoleViewOptions? options = null) #
Returns: IWidget

Builds the automatic (or requested) view for some items.

Parameters

items System.Collections.Generic.IReadOnlyList<System.Object?> requiredposition: 0
The items.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The widget.

public static BarChart BuildChart(IReadOnlyList<Object?> items, ConsoleViewOptions? options = null) #
Returns: BarChart

A bar chart: numbers as they are, or objects as label (first text member) and value (first number member).

Parameters

items System.Collections.Generic.IReadOnlyList<System.Object?> requiredposition: 0
The items.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The chart.

public static Table BuildTable(IReadOnlyList<Object?> items, ConsoleViewOptions? options = null) #
Returns: Table

A table of the items' members, with presenters chosen by member name and type.

Parameters

items System.Collections.Generic.IReadOnlyList<System.Object?> requiredposition: 0
The items.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The table.

public static Tree BuildTree(IReadOnlyList<Object?> items, ConsoleViewOptions? options = null) #
Returns: Tree

A tree of the items and their children (ConsoleViewOptions.ChildProperty or found automatically).

Parameters

items System.Collections.Generic.IReadOnlyList<System.Object?> requiredposition: 0
The items.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The tree.

public static ConsoleViewKind Decide(IReadOnlyList<Object?> items, ConsoleViewOptions? options = null) #
Returns: ConsoleViewKind

The view the data gets (see the class remarks): ConsoleViewOptions.View wins when set.

Parameters

items System.Collections.Generic.IReadOnlyList<System.Object?> requiredposition: 0
The items.
options ConsoleMonster.Views.ConsoleViewOptions? = null optionalposition: 1
Options, or null.

Returns

The view.