Skip to content
ConsoleMonster
Class

TextDiffView

ConsoleMonster.Changes

Namespace
ConsoleMonster.Changes
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A text diff in the object-preview pass/fail tones: side by side at 120 columns and above, inline below. Line numbers and minus/plus markers distinguish removals and additions without colour. Changed words are emphasised.

Inheritance

  • object
  • TextDiffView

Constructors

public TextDiffView(TextDiffResult comparison) #

Creates a view of a reusable text comparison.

Parameters

comparison ConsoleMonster.Changes.TextDiffResult required
The comparison, including context and source labels.

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 TextDiffResult Comparison { get; } #

The immutable comparison rendered by this widget.