StandardStreamExtensionsOpenStream Method

Creates a Stream instance for a StandardStream.

Definition

Namespace: Ookii.CommandLine.Terminal
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public static Stream OpenStream(
	this StandardStream stream
)

Parameters

stream  StandardStream
A StandardStream value.

Return Value

Stream
The return value of either ConsoleOpenStandardOutput, ConsoleOpenStandardError, or ConsoleOpenStandardInput.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type StandardStream. 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

The returned Stream instance should be disposed by the caller.

Exceptions

ArgumentExceptionstream was not a valid StandardStream value.

See Also