Skip to content
ConsoleMonster

API Reference

Class

ColumnFormat

Namespace ConsoleMonster.Layout
Assembly ConsoleMonster
Modifiers sealed

How a widget lays out one of its stat columns (counts, percentages, values, details) across rows. Every row of a widget shares the column's width, so numbers line up; during a live session the width never shrinks, so columns do not jump when a value grows from 9 to 10 or drops back.

Inheritance

  • Object
  • ColumnFormat

Remarks

The width of a column is the largest of: its widest current value, ColumnFormat.MinWidth, the width reserved by ColumnFormat.ReserveDigits (numeric columns), the width of a known maximum the widget supplies (a lane total, an overall total), and the widest width the column has used so far.

Usage

Explore 66 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 48

Constructors

public ColumnFormat(HorizontalAlignment alignment = Right, Int32 minWidth = 0, Int32 reserveDigits = 0) #

Creates a column format.

Parameters

alignment ConsoleMonster.Layout.HorizontalAlignment = Right optionalposition: 0
Alignment of values inside the column.
minWidth System.Int32 = 0 optionalposition: 1
Minimum width in cells.
reserveDigits System.Int32 = 0 optionalposition: 2
Digits reserved for numeric values (0 = only what the widget knows or has seen).

Properties

public HorizontalAlignment Alignment { get; set; } #

Alignment of values inside the column; numbers default to right.

public Int32 MinWidth { get; set; } #

Minimum width in cells (never negative).

public Int32 ReserveDigits { get; set; } #

Digits reserved for numeric values, for example 4 to keep room for 9999 from the first frame. Zero (the default) reserves only what the widget knows (its totals) or has already displayed.

public Boolean NeverShrink { get; set; } #

When false, the column follows its current values and may shrink; defaults to true.

Extension Methods

public static ColumnFormat WithAlignment(ColumnFormat columnFormat, HorizontalAlignment value) #
Returns: ColumnFormat

Sets ColumnFormat.Alignment: Alignment of values inside the column; numbers default to right.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat requiredposition: 0
The instance.
value ConsoleMonster.Layout.HorizontalAlignment requiredposition: 1
The value.

Returns

The same instance.

public static ColumnFormat WithMinWidth(ColumnFormat columnFormat, Int32 value) #
Returns: ColumnFormat

Sets ColumnFormat.MinWidth: Minimum width in cells (never negative).

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static ColumnFormat WithNeverShrink(ColumnFormat columnFormat, Boolean value = true) #
Returns: ColumnFormat

Sets ColumnFormat.NeverShrink: When false, the column follows its current values and may shrink; defaults to true.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static ColumnFormat WithReserveDigits(ColumnFormat columnFormat, Int32 value) #
Returns: ColumnFormat

Sets ColumnFormat.ReserveDigits: Digits reserved for numeric values, for example 4 to keep room for 9999 from the first frame. Zero (the default) reserves only what the widget knows (its totals) or has already displayed.

Parameters

columnFormat ConsoleMonster.Layout.ColumnFormat requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.