Class ParagraphFormat
Sparse paragraph-level formatting (ECMA-376 Part 1 §17.3.1 w:pPr). Every property is nullable — null means "not specified here"; effective values come from the style chain via the style resolver. All lengths are twips except LineSpacing, whose unit depends on LineSpacingRule.
public sealed class ParagraphFormat : UnknownXmlHost
- Inheritance
-
ParagraphFormat
- Inherited Members
Constructors
Properties
- Alignment
Gets or sets the alignment (w:jc), or null.
- Bidi
Gets or sets right-to-left paragraph direction (w:bidi), or null.
- Borders
Gets or sets the paragraph borders (w:pBdr), or null.
- ContextualSpacing
Gets or sets contextual spacing (w:contextualSpacing: suppress before/after spacing between same-style paragraphs), or null.
- FormatChange
Gets or sets the tracked formatting change (w:pPrChange), or null. The properties above stay the paragraph's current formatting; the annotation carries what preceded it.
Excluded from ContentEquals(ParagraphFormat?) and GetContentHash() for the same reason as FormatChange: it does not affect how the paragraph resolves.
- IndentFirstLine
Gets or sets the first-line indent (w:ind w:firstLine), or null. Mutually exclusive with IndentHanging; when both are written, hanging wins (§17.3.1.12).
- IndentHanging
Gets or sets the hanging indent (w:ind w:hanging), or null.
- IndentLeft
Gets or sets the left/leading indent (w:ind w:left|w:start), or null.
- IndentRight
Gets or sets the right/trailing indent (w:ind w:right|w:end), or null.
- KeepLines
Gets or sets keep-lines-together (w:keepLines), or null.
- KeepNext
Gets or sets keep-with-next (w:keepNext), or null.
- LineSpacing
Gets or sets the raw line spacing value (w:spacing w:line), or null. For Auto the unit is 240ths of a line; otherwise twips.
- LineSpacingRule
Gets or sets how LineSpacing is interpreted (w:spacing w:lineRule), or null.
- MirrorIndents
Gets or sets mirrored indents (w:mirrorIndents), or null.
- NumberingId
Gets or sets the referenced numbering instance id (w:numPr/w:numId), or null.
- NumberingLevel
Gets or sets the zero-based numbering level (w:numPr/w:ilvl), or null.
- OutlineLevel
Gets or sets the outline level, 0–8 (w:outlineLvl; 9 = body text), or null.
- PageBreakBefore
Gets or sets page-break-before (w:pageBreakBefore), or null.
- Shading
Gets or sets the paragraph shading (w:shd), or null.
- SpacingAfter
Gets or sets the space after the paragraph (w:spacing w:after), or null.
- SpacingAfterAuto
Gets or sets automatic after-spacing (w:spacing w:afterAutospacing), or null.
- SpacingBefore
Gets or sets the space before the paragraph (w:spacing w:before), or null.
- SpacingBeforeAuto
Gets or sets automatic before-spacing (w:spacing w:beforeAutospacing), or null.
- StyleId
Gets or sets the referenced paragraph style id (w:pStyle), or null.
- SuppressAutoHyphens
Gets or sets automatic-hyphenation suppression (w:suppressAutoHyphens), or null.
- SuppressLineNumbers
Gets or sets line-number suppression (w:suppressLineNumbers), or null.
- Tabs
Gets or sets the custom tab stops (w:tabs) exactly as written, including Clear entries, or null when the paragraph specifies none.
- TextAlignment
Gets or sets the raw ST_TextAlignment token for vertical character alignment on the line (w:textAlignment §17.18.91), or null.
- WidowControl
Gets or sets widow/orphan control (w:widowControl), or null.
Methods
- Clone()
Creates a deep copy, including preserved unknown-XML islands.
- ContentEquals(ParagraphFormat?)
Determines whether another bag specifies exactly the same values. Unknown-XML islands are ignored. Used by the style resolver's memoization.
- GetContentHash()
Computes a hash over the specified values, consistent with ContentEquals(ParagraphFormat?). Allocation-free.
- OverlayOnto(ParagraphFormat)
Copies every specified value onto
target, leaving the target's other values untouched (last-writer-wins layering).