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
valuecharThe 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
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
bufferchar[]The character array to write data from.
indexintThe character position in the buffer at which to start retrieving data.
countintThe number of characters to write.
Returns
- Task
A task that represents the asynchronous write operation.
Exceptions
- ArgumentNullException
bufferis null.- ArgumentException
The
indexpluscountis greater than the buffer length.- ArgumentOutOfRangeException
indexorcountis 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
bufferReadOnlyMemory<char>The character memory region to write to the text stream.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests. The default value is None.
Returns
- Task
A task that represents the asynchronous write operation.