Skip to content
ConsoleMonster
Class

CultureScope

ConsoleMonster.Layout

Namespace
ConsoleMonster.Layout
Assembly
ConsoleMonster
Modifiers
sealed

Renders a widget with a fixed culture for numbers, dates and durations, whatever the terminal's culture is (used by Show-Console -View List -AsWidget -Culture, so the culture travels with the widget into exports and dashboards).

Inheritance

  • object
  • CultureScope

Constructors

public CultureScope(IWidget child, CultureInfo culture) #

Creates the scope.

Parameters

child ConsoleMonster.Layout.IWidget required
The widget.
culture System.Globalization.CultureInfo required
The culture.

Methods

public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

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

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public IWidget Child { get; } #

The widget.

public CultureInfo Culture { get; } #

The culture.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.