/// <summary> /// Copies the buffered content to the unbuffered writer and invokes flush on it. /// Additionally causes this instance to no longer buffer and direct all write operations /// to the unbuffered writer. /// </summary> /// <returns>A <see cref="Task"/> that represents the asynchronous copy and flush operations.</returns> public override Task FlushAsync() { if (IsBuffering) { IsBuffering = false; TargetWriter = UnbufferedWriter; Buffer.WriteTo(UnbufferedWriter, HtmlEncoder); } return(UnbufferedWriter.FlushAsync()); }
/// <summary> /// Copies the buffered content to the unbuffered writer and invokes flush on it. /// Additionally causes this instance to no longer buffer and direct all write operations /// to the unbuffered writer. /// </summary> /// <returns>A <see cref="Task"/> that represents the asynchronous copy and flush operations.</returns> public override async Task FlushAsync() { if (IsBuffering) { IsBuffering = false; TargetWriter = UnbufferedWriter; await CopyToAsync(UnbufferedWriter); } await UnbufferedWriter.FlushAsync(); }
/// <summary> /// Copies the buffered content to the unbuffered writer and invokes flush on it. /// Additionally causes this instance to no longer buffer and direct all write operations /// to the unbuffered writer. /// </summary> public override void Flush() { if (IsBuffering) { IsBuffering = false; TargetWriter = UnbufferedWriter; Buffer.WriteTo(UnbufferedWriter, HtmlEncoder); } UnbufferedWriter.Flush(); }
/// <summary> /// Copies the buffered content to the unbuffered writer and invokes flush on it. /// Additionally causes this instance to no longer buffer and direct all write operations /// to the unbuffered writer. /// </summary> public override void Flush() { if (IsBuffering) { IsBuffering = false; TargetWriter = UnbufferedWriter; CopyTo(UnbufferedWriter); } UnbufferedWriter.Flush(); }