IndentedTextWriter.WriteLineAsync Method

Definition

Overloads

WriteLineAsync()

Asynchronously writes the line terminator to the underlying TextWriter.

WriteLineAsync(Char)

Asynchronously writes the specified Char to the underlying TextWriter followed by a line terminator, inserting tabs at the start of every line.

WriteLineAsync(String)

Asynchronously writes the specified string followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)

Asynchronously writes the specified characters followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

WriteLineAsync(StringBuilder, CancellationToken)

Asynchronously writes the contents of the specified StringBuilder followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

WriteLineAsync(Char[], Int32, Int32)

Asynchronously writes the specified number of characters from the specified buffer followed by a line terminator, to the underlying TextWriter, starting at the specified index within the buffer, inserting tabs at the start of every line.

WriteLineAsync()

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the line terminator to the underlying TextWriter.

C#
public override System.Threading.Tasks.Task WriteLineAsync();

Returns

A Task representing the asynchronous line writing operation.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteLine().

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10

WriteLineAsync(Char)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the specified Char to the underlying TextWriter followed by a line terminator, inserting tabs at the start of every line.

C#
public override System.Threading.Tasks.Task WriteLineAsync(char value);

Parameters

value
Char

The character to write.

Returns

A Task representing the asynchronous operation.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteLine(Char).

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10

WriteLineAsync(String)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the specified string followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

C#
public override System.Threading.Tasks.Task WriteLineAsync(string? value);

Parameters

value
String

The string to write.

Returns

A Task representing the asynchronous operation.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteLine(String).

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10

WriteLineAsync(ReadOnlyMemory<Char>, CancellationToken)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the specified characters followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

C#
public override System.Threading.Tasks.Task WriteLineAsync(ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default);

Parameters

buffer
ReadOnlyMemory<Char>

The characters to write.

cancellationToken
CancellationToken

Token for canceling the operation.

Returns

A Task representing the asynchronous operation.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10

WriteLineAsync(StringBuilder, CancellationToken)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the contents of the specified StringBuilder followed by a line terminator to the underlying TextWriter, inserting tabs at the start of every line.

C#
public override System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default);

Parameters

value
StringBuilder

The text to write.

cancellationToken
CancellationToken

Token for canceling the operation.

Returns

A Task representing the asynchronous operation.

Exceptions

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10

WriteLineAsync(Char[], Int32, Int32)

Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs
Source:
IndentedTextWriter.cs

Asynchronously writes the specified number of characters from the specified buffer followed by a line terminator, to the underlying TextWriter, starting at the specified index within the buffer, inserting tabs at the start of every line.

C#
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count);

Parameters

buffer
Char[]

The buffer containing characters to write.

index
Int32

The index within the buffer to start writing at.

count
Int32

The number of characters to write.

Returns

A Task representing the asynchronous operation.

Remarks

This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as ArgumentException, are still thrown synchronously. For the stored exceptions, see the exceptions thrown by WriteLine(Char[], Int32, Int32).

Applies to

.NET 10 and other versions
Product Versions
.NET 6, 7, 8, 9, 10