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
titlestringThe prompt title.
choicesIEnumerable<string>The available choices.
cancellationTokenCancellationTokenA token to monitor for cancellation.
Returns
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
statusMessagestringThe status message to display.
actionFunc<Task>The action to execute.
cancellationTokenCancellationTokenA token to monitor for cancellation.
Returns
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
messagestringThe message to write.
WriteError(string)
Writes an error message to the console.
public void WriteError(string message)
Parameters
messagestringThe error message to write.
WriteInfo(string)
Writes an informational message to the console.
public void WriteInfo(string message)
Parameters
messagestringThe informational message to write.
WriteLine(string)
Writes a message to the console followed by a newline.
public void WriteLine(string message)
Parameters
messagestringThe message to write.
WriteMarkup(string)
Writes a message with markup to the console.
public void WriteMarkup(string markup)
Parameters
markupstringThe markup content to write.
WriteSuccess(string)
Writes a success message to the console.
public void WriteSuccess(string message)
Parameters
messagestringThe success message to write.
WriteWarning(string)
Writes a warning message to the console.
public void WriteWarning(string message)
Parameters
messagestringThe warning message to write.