Table of Contents

DelegatingTextWriter.WriteLineAsync Method

Definition

Namespace
DotMake.CommandLine.Util
Assembly
DotMake.CommandLine.dll

WriteLineAsync()

Asynchronously writes a line terminator to the text stream.

public override Task WriteLineAsync()

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteLineAsync(char)

Asynchronously writes a character to the text stream, followed by a line terminator.

public override Task WriteLineAsync(char value)

Parameters

value char

The character to write to the text stream.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteLineAsync(string?)

Asynchronously writes a string to the text stream, followed by a line terminator.

public override Task WriteLineAsync(string? value)

Parameters

value string

The string to write. If the value is null, only a line terminator is written.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteLineAsync(char[], int, int)

Asynchronously writes a subarray of characters to the text stream, followed by a line terminator.

public override Task WriteLineAsync(char[] buffer, int index, int count)

Parameters

buffer char[]

The character array to write data from.

index int

The character position in the buffer at which to start retrieving data.

count int

The number of characters to write.

Returns

Task

A task that represents the asynchronous write operation.

Exceptions

ArgumentNullException

buffer is null.

ArgumentException

The index plus count is greater than the buffer length.

ArgumentOutOfRangeException

index or count is negative.

ObjectDisposedException

The text writer is disposed.

InvalidOperationException

The text writer is currently in use by a previous write operation.

WriteLineAsync(ReadOnlyMemory<char>, CancellationToken)

Asynchronously writes the text representation of a character memory region to the text stream, followed by a line terminator.

public override Task WriteLineAsync(ReadOnlyMemory<char> buffer, CancellationToken cancellationToken = default)

Parameters

buffer ReadOnlyMemory<char>

The character memory region to write to the text stream.

cancellationToken CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

Task

A task that represents the asynchronous write operation.