ContainerBlock Class
A base class for container blocks.
public abstract class ContainerBlock : Block, ICollection<Block>, IEnumerable<Block>, IList<Block>, IReadOnlyCollection<Block>, IReadOnlyList<Block>, IEnumerableSee also
- Inheritance
BlockContainerBlock- Implements
Nested types
| Name | Description |
|---|---|
| ContainerBlock.Enumerator | Represents the Enumerator type. |
Constructors
| Name | Description |
|---|---|
| ContainerBlock(BlockParser?) | Initializes a new instance of the ContainerBlock class. |
ContainerBlock(BlockParser?)
ContainerBlock.csInitializes a new instance of the ContainerBlock class.
protected ContainerBlock(BlockParser? parser)Parameters
parserBlockParser?- The parser used to create this block.
Properties
| Name | Description |
|---|---|
| Count | Gets or sets the count. |
| IsReadOnly | Gets or sets the is read only. |
| LastChild | Gets the last child. |
Count
ContainerBlock.csIsReadOnly
ContainerBlock.csLastChild
ContainerBlock.csIndexers
| Name | Description |
|---|---|
| this[int] | Gets the value at the specified index. |
this[int]
ContainerBlock.csMethods
| Name | Description |
|---|---|
| Add(Block) | Performs the add operation. |
| Clear() | Performs the clear operation. |
| Contains(Block) | Performs the contains operation. |
| CopyTo(Block[], int) | Performs the copy to operation. |
| GetEnumerator() | Specialize enumerator. |
| HasValidSpan(bool) | Checks whether this container span is valid with respect to child block spans. |
| IndexOf(Block) | Performs the index of operation. |
| Insert(int, Block) | Performs the insert operation. |
| Remove(Block) | Performs the remove operation. |
| RemoveAt(int) | Removes at. |
| Sort(IComparer<Block>) | Performs the sort operation. |
| Sort(Comparison<Block>) | Performs the sort operation. |
| System.Collections.Generic.IEnumerable<Meziantou.Framework.Markdown.Syntax.Block>.GetEnumerator() | |
| System.Collections.IEnumerable.GetEnumerator() | |
| TransferChildrenTo(ContainerBlock) | Transfers all children from this container to destination. |
| UpdateSpanFromChildren(bool, bool) | Updates this container span from its child block spans. |
Add(Block)
ContainerBlock.csClear()
ContainerBlock.csPerforms the clear operation.
public void Clear()Contains(Block)
ContainerBlock.csCopyTo(Block[], int)
ContainerBlock.csGetEnumerator()
ContainerBlock.csHasValidSpan(bool)
ContainerBlock.csChecks whether this container span is valid with respect to child block spans.
IndexOf(Block)
ContainerBlock.csInsert(int, Block)
ContainerBlock.csRemove(Block)
ContainerBlock.csRemoveAt(int)
ContainerBlock.csSort overloads
Sort(IComparer<Block>)
ContainerBlock.csPerforms the sort operation.
Parameters
comparerIComparer<Block>
Sort(Comparison<Block>)
ContainerBlock.csPerforms the sort operation.
public void Sort(Comparison<Block> comparison)Parameters
comparisonComparison<Block>
System.Collections.Generic.IEnumerable<Meziantou.Framework.Markdown.Syntax.Block>.GetEnumerator()
ContainerBlock.csSystem.Collections.IEnumerable.GetEnumerator()
ContainerBlock.csTransferChildrenTo(ContainerBlock)
ContainerBlock.csTransfers all children from this container to destination.
public void TransferChildrenTo(ContainerBlock destination)Parameters
destinationContainerBlock- The destination container.
Exceptions
ArgumentNullException- Thrown if
destinationis null.
Remarks
Child order is preserved. This method does not recompute source or destination spans/trivia.
UpdateSpanFromChildren(bool, bool)
ContainerBlock.csUpdates this container span from its child block spans.
Parameters
recursivebool- When
true, updates descendant container blocks and inline containers recursively before updating this container. preserveSelfSpanbool- When
true, preserves this container current span and only expands it to include children. Whenfalse, recomputes from children only.
Returns
bool true when this container span changed; otherwise, false.