Class TableauFileJsonStream
Default ITableauFileJsonStream implementation.
Inheritance
object
TableauFileJsonStream
Namespace: Tableau.Migration.Content.Files
Assembly: Tableau.Migration.dll
Syntax
public class TableauFileJsonStream : ITableauFileJsonStream, IAsyncDisposable
Constructors
TableauFileJsonStream(Stream, CancellationToken, bool)
Creates a new TableauFileJsonStream object.
Declaration
public TableauFileJsonStream(Stream jsonContent, CancellationToken disposalCancel, bool leaveOpen = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | jsonContent | The JSON stream. |
| CancellationToken | disposalCancel | A cancellation token to obey, and to use when the editor is disposed. |
| bool | leaveOpen | Whether or not to close the stream on disposal. |
Properties
JsonContent
Gets a read/write stream to the JSON content.
Declaration
public Stream JsonContent { get; }
Property Value
| Type | Description |
|---|---|
| Stream |
Methods
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Declaration
public virtual ValueTask DisposeAsync()
Returns
| Type | Description |
|---|---|
| ValueTask | A task that represents the asynchronous dispose operation. |
GetJsonAsync(CancellationToken)
Gets the currently loaded JSON of the file, parsing the file if necessary. Changes to the JSON will be automatically saved before publishing.
Declaration
public Task<JsonNode> GetJsonAsync(CancellationToken cancel)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancel | The cancellation token to obey. |
Returns
| Type | Description |
|---|---|
| Task<JsonNode> | The mutable JSON node (root of the document). |