Table of Contents

Method ApplyStyle

Namespace
DocWright.Dom.Editing
Assembly
DocWright.Dom.dll

ApplyStyle(Paragraph, string)

Applies a paragraph style.

public static Paragraph ApplyStyle(this Paragraph paragraph, string styleId)

Parameters

paragraph Paragraph

The paragraph.

styleId string

The paragraph style id.

Returns

Paragraph

The same paragraph, so calls chain.

Exceptions

ArgumentNullException

An argument is null.

InvalidDocumentException

The document defines no paragraph style with that id (DXP1002).

ApplyStyle(RunContentInline, string)

Applies a character style to one run-content inline.

public static RunContentInline ApplyStyle(this RunContentInline inline, string styleId)

Parameters

inline RunContentInline

The run-content inline.

styleId string

The character style id.

Returns

RunContentInline

The same inline, so calls chain.

Exceptions

ArgumentNullException

An argument is null.

InvalidDocumentException

The document defines no character style with that id (DXP1002).

ApplyStyle(DocumentRange, string)

Applies a character style to every run-content inline in a range, recursing into nested content.

public static int ApplyStyle(this DocumentRange range, string styleId)

Parameters

range DocumentRange

The range.

styleId string

The character style id.

Returns

int

The number of inlines the style was applied to.

Exceptions

ArgumentNullException

An argument is null.

InvalidDocumentException

The document defines no character style with that id (DXP1002).