VirtualTerminalWriteLineFormatted Method

Writes a line to the standard output stream which, if virtual terminal sequences are supported, will use the specified formatting.

Definition

Namespace: Ookii.CommandLine.Terminal
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static void WriteLineFormatted(
	string text,
	TextFormat textFormat,
	TextFormat? reset = null
)

Parameters

text  String
The text to write.
textFormat  TextFormat
The formatting that should be applied to the text.
reset  NullableTextFormat  (Optional)
The VT sequence that should be used to undo the formatting, or to use TextFormatDefault.

Remarks

This method takes care of checking whether VT sequences are supported by using the EnableColor(StandardStream) method, and on Windows, will reset the console mode afterwards if needed.

The textFormat and reset parameters will be ignored if the standard output stream does not support VT sequences. In that case, the value of text will be written without formatting.

This method uses the LineWrappingTextWriter to ensure that the text is properly white-space wrapped at the console width.

See Also