Skip to content
ConsoleMonster

API Reference

Class

PresentationOptions

Namespace ConsoleMonster.Presenters
Assembly ConsoleMonster
Modifiers sealed

Culture, reference time and time zone for presenting values. Tables, record views, cards and key/value lists take one, so output is deterministic when these are fixed (tests, snapshots) and follows the user's settings otherwise.

Inheritance

  • Object
  • PresentationOptions

Usage

Explore 37 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 24

Constructors

public PresentationOptions() #

Methods

public PresenterContext CreateContext(RenderContext render) #
Returns: PresenterContext

Creates a presenter context for a render.

Parameters

render ConsoleMonster.Canvas.RenderContext requiredposition: 0
The render context.

Returns

The presenter context.

Properties

public CultureInfo? Culture { get; set; } #

The culture for numbers and dates, or null for the render culture (the profile's TerminalProfile.Culture, else the current culture).

public DateTimeOffset? Now { get; set; } #

The reference time for relative dates, or null for the current time at render.

public TimeZoneInfo? TimeZone { get; set; } #

The time zone for absolute dates, or null for local time.

Extension Methods

public static PresentationOptions WithCulture(PresentationOptions presentationOptions, CultureInfo? value) #
Returns: PresentationOptions

Sets PresentationOptions.Culture: The culture for numbers and dates, or null for the render culture (the profile's TerminalProfile.Culture, else the current culture).

Parameters

presentationOptions ConsoleMonster.Presenters.PresentationOptions requiredposition: 0
The instance.
value System.Globalization.CultureInfo? requiredposition: 1
The value.

Returns

The same instance.

public static PresentationOptions WithNow(PresentationOptions presentationOptions, DateTimeOffset? value) #
Returns: PresentationOptions

Sets PresentationOptions.Now: The reference time for relative dates, or null for the current time at render.

Parameters

presentationOptions ConsoleMonster.Presenters.PresentationOptions requiredposition: 0
The instance.
value System.DateTimeOffset? requiredposition: 1
The value.

Returns

The same instance.

public static PresentationOptions WithTimeZone(PresentationOptions presentationOptions, TimeZoneInfo? value) #
Returns: PresentationOptions

Sets PresentationOptions.TimeZone: The time zone for absolute dates, or null for local time.

Parameters

presentationOptions ConsoleMonster.Presenters.PresentationOptions requiredposition: 0
The instance.
value System.TimeZoneInfo? requiredposition: 1
The value.

Returns

The same instance.