Table of Contents

Class SpreadsheetTemplateDocument

Namespace
OdfKit.Spreadsheet
Assembly
OdfKit.dll

Represents an ODF spreadsheet template document (OTS). 表示 ODF 試算表範本文件(OTS)。

public sealed class SpreadsheetTemplateDocument : SpreadsheetDocument, IDisposable, IAsyncDisposable
Inheritance
SpreadsheetTemplateDocument
Implements
Inherited Members

Constructors

SpreadsheetTemplateDocument(OdfPackage)

Initializes a new instance of the SpreadsheetTemplateDocument class. 初始化 SpreadsheetTemplateDocument 類別的新執行個體。

public SpreadsheetTemplateDocument(OdfPackage package)

Parameters

package OdfPackage

The ODF package. / ODF 封裝。

Methods

Create()

Creates a new OTS spreadsheet template document. 建立新的 OTS 試算表範本文件。

public static SpreadsheetTemplateDocument Create()

Returns

SpreadsheetTemplateDocument

A new SpreadsheetTemplateDocument instance. / 新的 SpreadsheetTemplateDocument 執行個體。

CreateFromDocument(SpreadsheetDocument)

Creates a new OTS spreadsheet template document from an existing ODS spreadsheet document, preserving its sheet content and styles. 從現有的 ODS 試算表文件建立新的 OTS 試算表範本文件,完整保留其工作表內容與樣式。

public static SpreadsheetTemplateDocument CreateFromDocument(SpreadsheetDocument document)

Parameters

document SpreadsheetDocument

The spreadsheet document used as the template content source. / 作為範本內容來源的試算表文件。

Returns

SpreadsheetTemplateDocument

The created SpreadsheetTemplateDocument instance. / 建立完成的 SpreadsheetTemplateDocument 執行個體。

Load(Stream)

Loads an OTS spreadsheet template document from the specified stream. 從指定資料流載入 OTS 試算表範本文件。

public static SpreadsheetTemplateDocument Load(Stream stream)

Parameters

stream Stream

Returns

SpreadsheetTemplateDocument

The loaded SpreadsheetTemplateDocument instance. / 載入完成的 SpreadsheetTemplateDocument 執行個體。

Load(Stream, string?)

Short overload of Load that accepts stream and fileName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream 與 fileName;其餘可選參數使用預設值並轉呼叫最長 Load 多載。

public static SpreadsheetTemplateDocument Load(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

SpreadsheetTemplateDocument

Load(string)

Loads an OTS spreadsheet template document from the specified path. 從指定路徑載入 OTS 試算表範本文件。

public static SpreadsheetTemplateDocument Load(string path)

Parameters

path string

The OTS document path. / OTS 文件路徑。

Returns

SpreadsheetTemplateDocument

The loaded SpreadsheetTemplateDocument instance. / 載入完成的 SpreadsheetTemplateDocument 執行個體。

LoadAsync(Stream)

Asynchronously loads an OTS spreadsheet template document from the specified stream. 非同步從指定資料流載入 OTS 試算表範本文件。

public static Task<SpreadsheetTemplateDocument> LoadAsync(Stream stream)

Parameters

stream Stream

Returns

Task<SpreadsheetTemplateDocument>

A task representing the asynchronous load operation, with the loaded SpreadsheetTemplateDocument as its result. / 代表非同步載入作業的工作,其結果為載入完成的 SpreadsheetTemplateDocument

LoadAsync(Stream, string?)

Short overload of LoadAsync that accepts stream and fileName; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream 與 fileName;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<SpreadsheetTemplateDocument> LoadAsync(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

Task<SpreadsheetTemplateDocument>

LoadAsync(Stream, string?, CancellationToken)

Short overload of LoadAsync that accepts stream, fileName, and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 stream、fileName 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<SpreadsheetTemplateDocument> LoadAsync(Stream stream, string? fileName, CancellationToken cancellationToken)

Parameters

stream Stream
fileName string
cancellationToken CancellationToken

Returns

Task<SpreadsheetTemplateDocument>

LoadAsync(Stream, CancellationToken)

Asynchronously loads the document from a stream with a cancellation token. 以取消語彙基元非同步從資料流載入文件。

public static Task<SpreadsheetTemplateDocument> LoadAsync(Stream stream, CancellationToken cancellationToken)

Parameters

stream Stream

The document stream. / 文件資料流。

cancellationToken CancellationToken

The cancellation token. / 取消語彙基元。

Returns

Task<SpreadsheetTemplateDocument>

A task whose result is the loaded document. / 代表非同步載入作業的工作,其結果為載入完成的文件。

LoadAsync(string)

Asynchronously loads an OTS spreadsheet template document from the specified path. 非同步從指定路徑載入 OTS 試算表範本文件。

public static Task<SpreadsheetTemplateDocument> LoadAsync(string path)

Parameters

path string

Returns

Task<SpreadsheetTemplateDocument>

A task representing the asynchronous load operation, with the loaded SpreadsheetTemplateDocument as its result. / 代表非同步載入作業的工作,其結果為載入完成的 SpreadsheetTemplateDocument

LoadAsync(string, CancellationToken)

Short overload of LoadAsync that accepts path and cancellationToken; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 path 與 cancellationToken;其餘可選參數使用預設值並轉呼叫最長 LoadAsync 多載。

public static Task<SpreadsheetTemplateDocument> LoadAsync(string path, CancellationToken cancellationToken)

Parameters

path string
cancellationToken CancellationToken

Returns

Task<SpreadsheetTemplateDocument>