Skip to content
ConsoleMonster

API Reference

Class

Rule

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Source Rule.cs:13
Implements
Modifiers sealed

A horizontal line across the width, optionally with a title: ── Results ──────.

Inheritance

  • Object
  • Rule

Usage

Explore 13 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.

Returned or exposed by 7

Accepted by parameters 6

Constructors

Rule 2 overloads
public Rule(RichText title) #

Creates a rule with a multicolour title.

Parameters

title ConsoleMonster.Text.RichText requiredposition: 0
The title.
public Rule(String? title = null) #

Creates a rule with an optional title (markup).

Parameters

title System.String? = null optionalposition: 0
The title, or null.

Methods

public Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Properties

public String? Title { get; set; } #

The title (markup).

public HorizontalAlignment Alignment { get; set; } #

Title alignment (default left).

public ThemeToken LineToken { get; set; } #

The line's theme token (default ThemeToken.Border).

Extension Methods

public static Rule WithAlignment(Rule rule, HorizontalAlignment value) #
Returns: Rule

Sets Rule.Alignment: Title alignment (default left).

Parameters

rule ConsoleMonster.Widgets.Rule requiredposition: 0
The instance.
value ConsoleMonster.Layout.HorizontalAlignment requiredposition: 1
The value.

Returns

The same instance.

public static Rule WithLineToken(Rule rule, ThemeToken value) #
Returns: Rule

Sets Rule.LineToken: The line's theme token (default ThemeToken.Border).

Parameters

rule ConsoleMonster.Widgets.Rule requiredposition: 0
The instance.
value ConsoleMonster.Styling.ThemeToken requiredposition: 1
The value.

Returns

The same instance.

public static Rule WithTitle(Rule rule, String? value) #
Returns: Rule

Sets Rule.Title: The title (markup).

Parameters

rule ConsoleMonster.Widgets.Rule requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.