Table of Contents

Class OdfSection

Namespace
OdfKit.Text
Assembly
OdfKit.dll

Represents a multi-column layout section in a text document. 表示文字文件中的多欄版面配置區段。

public class OdfSection
Inheritance
OdfSection
Inherited Members

Properties

IsProtected

Gets or sets whether this section is protected (maps to text:protected). 取得或設定此區段是否受保護(對應 text:protected)。

public bool IsProtected { get; set; }

Property Value

bool

Remarks

用於將範本中特定區段標記為唯讀,防止使用者在套用範本後誤改其內容;實際強制力取決於 使用者端應用程式(例如 LibreOffice)是否遵循此標記,OdfKit 本身不會阻擋對受保護區段的程式化修改。

WritingMode

Gets or sets the writing mode of this section. 取得或設定此區段的書寫模式。

public string? WritingMode { get; set; }

Property Value

string

Methods

Protect(string)

Protects this section with the specified password. 以指定密碼保護此區段。

public void Protect(string password)

Parameters

password string

The plain-text password. / 密碼明文。

TryUnprotect(string)

Attempts to remove this section's protection using the specified password. 嘗試以指定密碼解除此區段的保護。

public bool TryUnprotect(string password)

Parameters

password string

The plain-text password. / 密碼明文。

Returns

bool

true if unprotection succeeded; otherwise false. / 若解除成功則為 true,否則為 false。

Unprotect()

Removes password protection from this section. 解除此區段的密碼保護。

public void Unprotect()

VerifyPassword(string)

Verifies whether the specified password can unlock this section. 驗證指定密碼是否能成功解鎖此區段。

public bool VerifyPassword(string password)

Parameters

password string

The plain-text password. / 密碼明文。

Returns

bool

true if the password is correct or the section is unprotected; otherwise false. / 若密碼正確或區段未受保護則為 true,否則為 false。