Table of Contents

Interface IBlockContainer

Namespace
DocWright.Composition
Assembly
DocWright.Composition.dll

A container that holds block-level content. Decorator members return the container so they can be chained ahead of a content member, which places the content.

public interface IBlockContainer

Remarks

There is no box model behind the decorators: padding becomes paragraph spacing and indent, or cell margins; borders and backgrounds become paragraph or cell properties. COMPAT.md states each divergence.

Methods

AlignCenter()

Centres the content.

AlignLeft()

Left-aligns the content.

AlignRight()

Right-aligns the content.

Background(ColorRgb)

Shades the content. This is paragraph or cell shading, not an arbitrary region.

Border(double)

Draws a border around the content — paragraph borders on a block, cell borders inside a table.

Border(double, ColorRgb)

Draws a coloured border around the content.

Column(Action<IColumnComposer>)

Places a sequence of blocks, one after another.

Divider()

Places a horizontal rule, which lowers to a paragraph carrying a bottom border.

Divider(double, ColorRgb)

Places a horizontal rule of a given weight and colour.

Image(byte[], string)

Places an inline picture sized from the image's own pixel dimensions at 96 DPI.

This overload decodes the image to learn its size, because the model carries display extent rather than intrinsic size. PNG and JPEG only. Pass explicit dimensions to avoid the decode.

Image(byte[], string, double, double, Unit)

Places an inline picture at an explicit display size.

Justify()

Justifies the content.

KeepWithNext()

Keeps this content on the same page as the content that follows it.

List(Action<IListComposer>)

Places an ordered or bulleted list.

Padding(double, Unit)

Adds padding on all four sides.

PaddingBottom(double, Unit)

Adds padding below.

PaddingHorizontal(double, Unit)

Adds padding to the left and right.

PaddingLeft(double, Unit)

Adds padding on the left.

PaddingRight(double, Unit)

Adds padding on the right.

PaddingTop(double, Unit)

Adds padding above.

PaddingVertical(double, Unit)

Adds padding above and below.

PageBreak()

Places an explicit page break. This is a document instruction, not a layout decision — where a page breaks on its own is the layout engine's business.

Row(Action<IRowComposer>)

Places content side by side. This lowers to a borderless single-row table, which is what Word itself does; see COMPAT.md for the consequences.

Style(string)

Applies a named style to the content.

Table(Action<ITableComposer>)

Places a table.

Text(Action<ITextComposer>)

Places text composed of several spans.

Text(string)

Places a run of text.