Class PlainTextDocumentRenderer<T>
An IDocumentRenderer<T> which writes to a TextWriter and discards all annotations.
Inheritance
- Object
- PlainTextDocumentRenderer<T>
- PlainTextDocumentRenderer
Implements
Declaration
public class PlainTextDocumentRenderer<T> : Object, IDocumentRenderer<T>
Type Parameters
Name | Description |
---|---|
T |
Constructors
PlainTextDocumentRenderer(TextWriter)
Create a PlainTextDocumentRenderer<T>
Declaration
public PlainTextDocumentRenderer(TextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
writer |
The output TextWriter |
Properties
Writer
The output TextWriter
Declaration
protected TextWriter Writer { get; }
Property Value
Type | Description |
---|---|
Methods
NewLine(CancellationToken)
Write a line break into the output stream.
Declaration
public virtual ValueTask NewLine(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
cancellationToken |
Returns
Type | Description |
---|---|
A ValueTask which will complete when the line break has been written to the output stream |
PopAnnotation(CancellationToken)
Discard the value of a previous call to PushAnnotation(T, CancellationToken)
Declaration
public virtual ValueTask PopAnnotation(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
cancellationToken |
Returns
Type | Description |
---|---|
A ValueTask which will complete when the value has been popped from the stack |
PushAnnotation(T, CancellationToken)
Accept an annotation
Declaration
public virtual ValueTask PushAnnotation(T value, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
T |
value |
The annotation to push onto the stack |
cancellationToken |
Returns
Type | Description |
---|---|
A ValueTask which will complete when the value has been pushed onto the stack |
Text(ReadOnlyMemory<Char>, CancellationToken)
Write some text into the output stream
Declaration
public virtual ValueTask Text(ReadOnlyMemory<char> memory, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
memory |
The text to write to the output stream |
|
cancellationToken |
Returns
Type | Description |
---|---|
A ValueTask which will complete when the text has been written to the output stream |
WhiteSpace(Int32, CancellationToken)
Write the given amount
of
blank space into the output stream.
Declaration
public virtual ValueTask WhiteSpace(int amount, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
amount |
The amount of white space to write |
|
cancellationToken |
Returns
Type | Description |
---|---|
A ValueTask which will complete when the white space has been written to the output stream |