StandardStreamExtensionsGetStandardStream(TextWriter) Method

Gets the StandardStream associated with a TextWriter instance, if that instance is for either the standard output or error stream.

Definition

Namespace: Ookii.CommandLine.Terminal
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static StandardStream? GetStandardStream(
	this TextWriter writer
)

Parameters

writer  TextWriter
The TextWriter.

Return Value

NullableStandardStream
The StandardStream that writer is writing to, or if it's not writing to either the standard output or standard error stream.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TextWriter. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

If writer is an instance of the LineWrappingTextWriter class, the value of the LineWrappingTextWriterBaseWriter property will be checked.

Exceptions

See Also