Table of Contents

Class NullOutputConsole

Namespace
ProjGraph.Lib.Core.Abstractions
Assembly
ProjGraph.Lib.Core.dll

A no-op implementation of IOutputConsole that discards all output. Useful in contexts where console output is not needed, such as MCP servers (where stdout is reserved for JSON-RPC transport) or unit tests.

public sealed class NullOutputConsole : IOutputConsole
Inheritance
NullOutputConsole
Implements
Inherited Members

Methods

PromptSelectionAsync(string, IEnumerable<string>, CancellationToken)

Displays a selection prompt and returns the user's choice.

public Task<string> PromptSelectionAsync(string title, IEnumerable<string> choices, CancellationToken cancellationToken = default)

Parameters

title string

The prompt title.

choices IEnumerable<string>

The available choices.

cancellationToken CancellationToken

A token to monitor for cancellation.

Returns

Task<string>

The selected choice.

Remarks

Returns the first available choice without prompting, or throws if no choices are available.

RunWithStatusAsync(string, Func<Task>, CancellationToken)

Displays a status spinner while executing an asynchronous action.

public Task RunWithStatusAsync(string statusMessage, Func<Task> action, CancellationToken cancellationToken = default)

Parameters

statusMessage string

The status message to display.

action Func<Task>

The action to execute.

cancellationToken CancellationToken

A token to monitor for cancellation.

Returns

Task

Remarks

Executes the action immediately without displaying status.

Write(string)

Writes a message to the console without a newline.

public void Write(string message)

Parameters

message string

The message to write.

WriteError(string)

Writes an error message to the console.

public void WriteError(string message)

Parameters

message string

The error message to write.

WriteInfo(string)

Writes an informational message to the console.

public void WriteInfo(string message)

Parameters

message string

The informational message to write.

WriteLine(string)

Writes a message to the console followed by a newline.

public void WriteLine(string message)

Parameters

message string

The message to write.

WriteMarkup(string)

Writes a message with markup to the console.

public void WriteMarkup(string markup)

Parameters

markup string

The markup content to write.

WriteSuccess(string)

Writes a success message to the console.

public void WriteSuccess(string message)

Parameters

message string

The success message to write.

WriteWarning(string)

Writes a warning message to the console.

public void WriteWarning(string message)

Parameters

message string

The warning message to write.