Table of Contents

Class FormulaTemplateDocument

Namespace
OdfKit.Formula
Assembly
OdfKit.dll

Represents an ODF formula template document (OTF). 表示 ODF 公式範本文件(OTF)。

public sealed class FormulaTemplateDocument : FormulaDocument, IDisposable, IAsyncDisposable
Inheritance
FormulaTemplateDocument
Implements
Inherited Members

Constructors

FormulaTemplateDocument(OdfPackage)

Initializes a new instance of the FormulaTemplateDocument class with the specified ODF package. 使用指定的 ODF 封裝初始化 FormulaTemplateDocument 類別的新執行個體。

public FormulaTemplateDocument(OdfPackage package)

Parameters

package OdfPackage

The ODF package instance. / ODF 封裝執行個體。

FormulaTemplateDocument(OdfPackage, string)

Initializes a new instance of the FormulaTemplateDocument class with the specified ODF package and sub-path. 使用指定的 ODF 封裝與子路徑初始化 FormulaTemplateDocument 類別的新執行個體。

public FormulaTemplateDocument(OdfPackage package, string subPath)

Parameters

package OdfPackage

The ODF package instance. / ODF 封裝執行個體。

subPath string

The sub-path within the package. / 封裝內的子路徑。

Methods

Create()

Creates a new OTF formula template document. 建立新的 OTF 公式範本文件。

public static FormulaTemplateDocument Create()

Returns

FormulaTemplateDocument

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

CreateFromDocument(FormulaDocument)

Creates a new OTF formula template document from an existing ODF formula document, preserving its MathML formula content. 從現有的 ODF 公式文件建立新的 OTF 公式範本文件,完整保留其 MathML 公式內容。

public static FormulaTemplateDocument CreateFromDocument(FormulaDocument document)

Parameters

document FormulaDocument

The formula document used as the template content source. / 作為範本內容來源的公式文件。

Returns

FormulaTemplateDocument

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

Load(Stream)

Loads an OTF formula template document from the specified stream. 從指定資料流載入 OTF 公式範本文件。

public static FormulaTemplateDocument Load(Stream stream)

Parameters

stream Stream

Returns

FormulaTemplateDocument

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

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 FormulaTemplateDocument Load(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

FormulaTemplateDocument

Load(string)

Loads an OTF formula template document from the specified path. 從指定路徑載入 OTF 公式範本文件。

public static FormulaTemplateDocument Load(string path)

Parameters

path string

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

Returns

FormulaTemplateDocument

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

LoadAsync(Stream)

Asynchronously loads an OTF formula template document from the specified stream. 非同步從指定資料流載入 OTF 公式範本文件。

public static Task<FormulaTemplateDocument> LoadAsync(Stream stream)

Parameters

stream Stream

Returns

Task<FormulaTemplateDocument>

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

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<FormulaTemplateDocument> LoadAsync(Stream stream, string? fileName)

Parameters

stream Stream
fileName string

Returns

Task<FormulaTemplateDocument>

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<FormulaTemplateDocument> LoadAsync(Stream stream, string? fileName, CancellationToken cancellationToken)

Parameters

stream Stream
fileName string
cancellationToken CancellationToken

Returns

Task<FormulaTemplateDocument>

LoadAsync(Stream, CancellationToken)

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

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

Parameters

stream Stream

The document stream. / 文件資料流。

cancellationToken CancellationToken

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

Returns

Task<FormulaTemplateDocument>

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

LoadAsync(string)

Asynchronously loads an OTF formula template document from the specified path. 非同步從指定路徑載入 OTF 公式範本文件。

public static Task<FormulaTemplateDocument> LoadAsync(string path)

Parameters

path string

Returns

Task<FormulaTemplateDocument>

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

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<FormulaTemplateDocument> LoadAsync(string path, CancellationToken cancellationToken)

Parameters

path string
cancellationToken CancellationToken

Returns

Task<FormulaTemplateDocument>