Skip to content
ConsoleMonster
Class

LogViewport

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A focusable, capped log window over the shared LogRegion renderer. Writers never accumulate an unbounded UI queue.

Inheritance

Usage

Explore 36 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 18

Constructors

public LogViewport(string key) #

Creates a named log viewport.

Parameters

key string required

Methods

public string CopyText() #

Returns retained literal messages for an app's copy or export action.

Returns

string
public void Write(string text, string level = "info", TimeSpan time = default) #

Appends bounded literal text from any thread. Markup is never interpreted.

Parameters

text string required
level string = "info" optional
time System.TimeSpan = default optional

Properties

public int Capacity { get; set; } #

Maximum retained entries.

public int Height { get; set; } #

Preferred visible content rows.

public bool ShowElapsed { get; set; } #

Whether to show entry elapsed time.

public int ScrollOffset { get; set; } #

Rows skipped from the newest end; zero follows new output.

public int HorizontalOffset { get; set; } #

Horizontal scroll in display cells, bounded by the maximum retained message length.

public IReadOnlyList<LogEntry> Entries { get; } #

A detached entry snapshot.

Extension Methods

public static LogViewport Capacity(LogViewport logViewport, int value) #

Sets LogViewport.Capacity: Maximum retained entries.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value int required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property    // C# fluent
logViewport.Capacity = value;    logViewport.Capacity(value);
Disabled 2 overloads
public static LogViewport Disabled(LogViewport logViewport, bool value) #

Sets InputControl.Disabled: Whether this control is excluded from input and focus traversal.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value bool required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property    // C# fluent
logViewport.Disabled = value;    logViewport.Disabled(value);
public static LogViewport Disabled(LogViewport logViewport) #

Sets InputControl.Disabled to true.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance to configure.

Returns

LogViewport The same instance.
public static LogViewport Height(LogViewport logViewport, int value) #

Sets LogViewport.Height: Preferred visible content rows.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value int required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property    // C# fluent
logViewport.Height = value;      logViewport.Height(value);
public static LogViewport HorizontalOffset(LogViewport logViewport, int value) #

Sets LogViewport.HorizontalOffset: Horizontal scroll in display cells, bounded by the maximum retained message length.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value int required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property            // C# fluent
logViewport.HorizontalOffset = value;    logViewport.HorizontalOffset(value);
public static LogViewport Label(LogViewport logViewport, string? value) #

Sets InputControl.Label: The visible label, or null to use the name.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value string? required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property    // C# fluent
logViewport.Label = value;       logViewport.Label(value);
public static LogViewport ScrollOffset(LogViewport logViewport, int value) #

Sets LogViewport.ScrollOffset: Rows skipped from the newest end; zero follows new output.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value int required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property        // C# fluent
logViewport.ScrollOffset = value;    logViewport.ScrollOffset(value);
ShowElapsed 2 overloads
public static LogViewport ShowElapsed(LogViewport logViewport, bool value) #

Sets LogViewport.ShowElapsed: Whether to show entry elapsed time.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value bool required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property       // C# fluent
logViewport.ShowElapsed = value;    logViewport.ShowElapsed(value);
public static LogViewport ShowElapsed(LogViewport logViewport) #

Sets LogViewport.ShowElapsed to true.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance to configure.

Returns

LogViewport The same instance.
public static LogViewport TabIndex(LogViewport logViewport, int value) #

Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value int required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property    // C# fluent
logViewport.TabIndex = value;    logViewport.TabIndex(value);
public static LogViewport ValidationMessage(LogViewport logViewport, string? value) #

Sets InputControl.ValidationMessage: The current validation message below the control, or null.

Parameters

logViewport ConsoleMonster.Interactive.LogViewport required
The instance.
value string? required
The value.

Returns

LogViewport The same instance.

Examples

// C# initializer or property             // C# fluent
logViewport.ValidationMessage = value;    logViewport.ValidationMessage(value);