Class WrapBox
A block that applies wrapping and horizontal margins to its contents.
public sealed class WrapBox : BlockContainer
- Inheritance
-
WrapBox
- Inherited Members
Constructors
WrapBox(Block, WrappingStrategy)
Creates a wrapped block with no horizontal margins.
public WrapBox(Block contents, WrappingStrategy wrapping)
Parameters
contentsBlockThe block contents.
wrappingWrappingStrategyThe wrapping strategy to apply.
WrapBox(Block, WrappingStrategy, int)
Creates a wrapped block with equal horizontal margins.
public WrapBox(Block contents, WrappingStrategy wrapping, int margin)
Parameters
contentsBlockThe block contents.
wrappingWrappingStrategyThe wrapping strategy to apply.
marginintThe left and right margin width.
WrapBox(Block, WrappingStrategy, int, int)
Creates a wrapped block with horizontal margins.
public WrapBox(Block contents, WrappingStrategy wrapping, int leftMargin, int rightMargin)
Parameters
contentsBlockThe block contents.
wrappingWrappingStrategyThe wrapping strategy to apply.
leftMarginintThe left margin width.
rightMarginintThe right margin width.
WrapBox(Block, int)
Creates a character-wrapped block with equal horizontal margins.
public WrapBox(Block contents, int margin)
Parameters
WrapBox(Block, int, int)
Creates a character-wrapped block with horizontal margins.
public WrapBox(Block contents, int leftMargin, int rightMargin)
Parameters
contentsBlockThe block contents.
leftMarginintThe left margin width.
rightMarginintThe right margin width.
Properties
LeftMargin
Gets the left margin width.
public int LeftMargin { get; }
Property Value
RightMargin
Gets the right margin width.
public int RightMargin { get; }
Property Value
Wrapping
Gets the wrapping strategy applied to the contents.
public WrappingStrategy Wrapping { get; }
Property Value
Methods
IndentAndWordWrap(Block)
Creates a word-wrapped block with a standard left indent.
public static WrapBox IndentAndWordWrap(Block node)
Parameters
nodeBlockThe block to wrap.
Returns
- WrapBox
A word-wrapped block with a standard left indent.
IndentAndWordWrap(params Block[])
Creates a word-wrapped stack from a parameter list of blocks with a standard left indent.
public static WrapBox IndentAndWordWrap(params Block[] nodes)
Parameters
nodesBlock[]The blocks to wrap.
Returns
- WrapBox
A word-wrapped block with a standard left indent.
IndentAndWordWrap(IReadOnlyList<Block>)
Creates a word-wrapped stack with a standard left indent.
public static WrapBox IndentAndWordWrap(IReadOnlyList<Block> nodes)
Parameters
nodesIReadOnlyList<Block>The blocks to wrap.
Returns
- WrapBox
A word-wrapped block with a standard left indent.
WithContents(Block)
Creates a copy of this block container with different contents.
public override BlockContainer WithContents(Block newContents)
Parameters
newContentsBlockThe new block contents.
Returns
- BlockContainer
A new wrapped block with the updated contents.
WordWrap(Block)
Creates a word-wrapped block.
public static WrapBox WordWrap(Block node)
Parameters
nodeBlockThe block to wrap.
Returns
- WrapBox
A word-wrapped block.
WordWrap(params Block[])
Creates a word-wrapped stack from a parameter list of blocks.
public static WrapBox WordWrap(params Block[] nodes)
Parameters
nodesBlock[]The blocks to wrap.
Returns
- WrapBox
A word-wrapped block.
WordWrap(IReadOnlyList<Block>)
Creates a word-wrapped stack.
public static WrapBox WordWrap(IReadOnlyList<Block> nodes)
Parameters
nodesIReadOnlyList<Block>The blocks to wrap.
Returns
- WrapBox
A word-wrapped block.