Skip to content
ConsoleMonster
Class

PresentationOptions

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

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 42 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 28

Constructors

public PresentationOptions() #

Methods

public PresenterContext CreateContext(RenderContext render) #

Creates a presenter context for a render.

Parameters

render ConsoleMonster.Canvas.RenderContext required
The render context.

Returns

PresenterContext The presenter context.
public static DateTimeOffset ReferenceNow() #

Reads the presentation clock: CONSOLEMONSTER_NOW when it is a valid ISO timestamp, otherwise the current local time. This affects displayed timestamps, not elapsed-time measurements or scheduling.

Returns

DateTimeOffset The reference time, retaining the configured timestamp's offset.

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 CONSOLEMONSTER_NOW (recordings/tests) and then 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 Culture(PresentationOptions presentationOptions, CultureInfo? value) #

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 required
The instance.
value System.Globalization.CultureInfo? required
The value.

Returns

PresentationOptions The same instance.

Examples

// C# initializer or property                                                     // C# fluent
new global::ConsoleMonster.Presenters.PresentationOptions { Culture = value };    presentationOptions.Culture(value);
public static PresentationOptions Now(PresentationOptions presentationOptions, DateTimeOffset? value) #

Sets PresentationOptions.Now: The reference time for relative dates, or null for CONSOLEMONSTER_NOW (recordings/tests) and then the current time at render.

Parameters

presentationOptions ConsoleMonster.Presenters.PresentationOptions required
The instance.
value System.DateTimeOffset? required
The value.

Returns

PresentationOptions The same instance.

Examples

// C# initializer or property                                                 // C# fluent
new global::ConsoleMonster.Presenters.PresentationOptions { Now = value };    presentationOptions.Now(value);
public static PresentationOptions TimeZone(PresentationOptions presentationOptions, TimeZoneInfo? value) #

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

Parameters

presentationOptions ConsoleMonster.Presenters.PresentationOptions required
The instance.
value System.TimeZoneInfo? required
The value.

Returns

PresentationOptions The same instance.

Examples

// C# initializer or property                                                      // C# fluent
new global::ConsoleMonster.Presenters.PresentationOptions { TimeZone = value };    presentationOptions.TimeZone(value);