Class TableauFileEditor
Default ITableauFileEditor implementation.
Namespace: Tableau.Migration.Content.Files
Assembly: Tableau.Migration.dll
Syntax
public class TableauFileEditor : ITableauFileEditor, IAsyncDisposable
Constructors
TableauFileEditor(IContentFileHandle, RecyclableMemoryStream, ZipArchive?, CancellationToken)
Creates a new TableauFileEditor object.
Declaration
public TableauFileEditor(IContentFileHandle fileStoreFile, RecyclableMemoryStream content, ZipArchive? archive, CancellationToken disposalCancel)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | fileStoreFile | The file store file to edit. |
RecyclableMemoryStream | content | The memory backed stream with unencrypted tableau file data to write back to the file store upon disposal. |
ZipArchive | archive | The zip archive to use to manipulate the file, or null to consider the file as a single XML file. |
CancellationToken | disposalCancel | A cancellation token to obey, and to use when the editor is disposed. |
Properties
Archive
Gets the zip archive for the file, or null if the file is an unzipped XML file (TDS or TWB). The zip archive is backed by the Content stream.
Declaration
public ZipArchive? Archive { get; }
Property Value
Type | Description |
---|---|
ZipArchive |
Content
Gets the memory backed stream with unencrypted tableau file data to write back to the file store upon disposal.
Declaration
public RecyclableMemoryStream Content { get; }
Property Value
Type | Description |
---|---|
RecyclableMemoryStream |
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. |
GetXmlStream()
Gets the current read/write stream to the XML content of the Tableau file, opening a new stream if necessary. Changes to the stream will be automatically saved before publishing.
Declaration
public ITableauFileXmlStream GetXmlStream()
Returns
Type | Description |
---|---|
ITableauFileXmlStream | The XML stream to edit. |
OpenAsync(IContentFileHandle, IMemoryStreamManager, CancellationToken, bool?)
Opens a new Tableau file editor.
Declaration
public static Task<TableauFileEditor> OpenAsync(IContentFileHandle handle, IMemoryStreamManager memoryStreamManager, CancellationToken cancel, bool? zipFormatOverride = null)
Parameters
Type | Name | Description |
---|---|---|
IContentFileHandle | handle | The file store file to edit. |
IMemoryStreamManager | memoryStreamManager | The memory stream manager. |
CancellationToken | cancel | A cancellation token to obey, and to use when the editor is disposed. |
bool? | zipFormatOverride | True to consider the file a zip archive, false to consider the file an XML file, or null to detect whether the file is a zip archive. |
Returns
Type | Description |
---|---|
Task<TableauFileEditor> | The newly created file editor. |