Table of Contents

Class ComputedStyle

Namespace
OdfKit.Core
Assembly
OdfKit.dll

Represents the effective style values resolved for an ODF element. 表示為 ODF 元素解析後的有效樣式值。

public sealed class ComputedStyle
Inheritance
ComputedStyle
Inherited Members

Constructors

ComputedStyle()

public ComputedStyle()

Properties

BackgroundColor

Gets the resolved background color. 取得解析後的背景顏色。

public string? BackgroundColor { get; init; }

Property Value

string

Bold

Gets a value indicating the Bold state. 取得一個值,指出字型是否為粗體。

public bool Bold { get; init; }

Property Value

bool

Color

Gets the resolved text color. 取得解析後的文字顏色。

public string? Color { get; init; }

Property Value

string

FontName

Gets the resolved font family name. 取得解析後的字型家族名稱。

public string? FontName { get; init; }

Property Value

string

FontSize

Gets the resolved font size token. 取得解析後的字型大小語彙。

public string? FontSize { get; init; }

Property Value

string

Italic

Gets a value indicating the Italic state. 取得一個值,指出字型是否為斜體。

public bool Italic { get; init; }

Property Value

bool

TextAlignment

Gets the resolved text alignment value. 取得解析後的文字對齊值。

public string? TextAlignment { get; init; }

Property Value

string

Underline

Gets a value indicating the Underline state. 取得一個值,指出字型是否具有底線。

public bool Underline { get; init; }

Property Value

bool

Methods

Resolve(OdfElement)

Resolves the effective style values for the specified ODF element. 解析指定 ODF 元素的有效樣式值。

public static ComputedStyle Resolve(OdfElement element)

Parameters

element OdfElement

The ODF element to inspect. / 要檢查的 ODF 元素。

Returns

ComputedStyle

The resolved effective style values. / 解析後的有效樣式值。

Exceptions

ArgumentNullException

Thrown when element is null. / 當 elementnull 時擲出。