ConsoleView
ConsoleMonster.Views
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
public static IWidget Auto(object? value, ConsoleViewOptions? options = null) #Builds the automatic view for a value: a sequence is shown as its items, anything else as one item.
Parameters
- value object?
- The value.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.
public static IWidget Auto(IReadOnlyList<object?> items, ConsoleViewOptions? options = null) #Builds the automatic (or requested) view for some items.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- The items.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.
public static BarChart BuildChart(IReadOnlyList<object?> items, ConsoleViewOptions? options = null) #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<object?>
- The items.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.
public static CodeView BuildCode(IReadOnlyList<object?> items, ConsoleViewOptions options) #Builds highlighted code or JSON through the same representation factory as Show-Console.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- Text or structured JSON input.
- options ConsoleMonster.Views.ConsoleViewOptions
- Display configuration.
public static IWidget BuildErrors(IReadOnlyList<object?> items, ConsoleViewOptions options) #Builds one error view or a vertical sequence of error views.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- Exceptions, ExceptionInfo descriptors or error messages.
- options ConsoleMonster.Views.ConsoleViewOptions
- Error presentation configuration.
public static RecordView BuildList(IReadOnlyList<object?> items, ConsoleViewOptions options) #Builds a record sheet from ordinary C# objects or dictionaries.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- Records.
- options ConsoleMonster.Views.ConsoleViewOptions
- Title, property selection and empty-field policy.
public static Table BuildTable(IReadOnlyList<object?> items, ConsoleViewOptions? options = null) #A table of the items' members, with presenters chosen by member name and type.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- The items.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.
public static Tree BuildTree(IReadOnlyList<object?> items, ConsoleViewOptions? options = null) #A tree of the items and their children (ConsoleViewOptions.ChildrenProperty or found automatically).
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- The items.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.
public static ConsoleViewKind Decide(IReadOnlyList<object?> items, ConsoleViewOptions? options = null) #The view the data gets (see the class remarks): ConsoleViewOptions.View wins when set.
Parameters
- items System.Collections.Generic.IReadOnlyList<object?>
- The items.
- options ConsoleMonster.Views.ConsoleViewOptions? = null
- Options, or null.