Method ApplyStyle
ApplyStyle(Paragraph, string)
Applies a paragraph style.
public static Paragraph ApplyStyle(this Paragraph paragraph, string styleId)
Parameters
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
inlineRunContentInlineThe run-content inline.
styleIdstringThe 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
rangeDocumentRangeThe range.
styleIdstringThe 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).