ContentNode

Description

abstract class Tinman.Core.Document.ContentNode
<T ref : IDocumentNode>

Derived from

DocumentNode abstract
ICollector<T>

Extended by

ListItemNode sealed
ListNode sealed
MemberDocNode sealed
ParagraphNode sealed
TextDocument sealed
TypeDocNode sealed

Abstract base class for nodes in a text document that contain a sequence of nodes as content.

Public / Methods

Accept​Content

2 overloads


public method AcceptContent1 → (2)

visitor in : IDocumentNodeVisitor

The visitor to accept. If null the method returns silently.

userData in : object

Optional user data object.

Calls IDocumentNode.Accept on each content node.

IOException

If an I/O error has occurred.


public method AcceptContent2 → (4)

visitor in : IDocumentNodeVisitor

The visitor to accept. If null the method returns silently.

userDataFirst in : object

The user data object to pass to the first content element.

userDataLast in : object

The user data object to pass to the last content element.

userDataOther in : object

The user data object to pass to all other content elements.

Calls IDocumentNode.Accept on each content node.

The user data object OBJ for a content element at index n is found as follows:

  1. OBJ is set to null.

  2. If n is equal to 0, OBJ is set to userDataFirst in.

  3. If OBJ is null and n is equal to N-1, OBJ is set to userDataLast in.

  4. If OBJ is null, OBJ is set to userDataOther in.

where N is the number of context elements.

IOException

If an I/O error has occurred.

Find

2 overloads


[Pure]
public method Find1 → (1)

element in : T

The content node.

returns → int32

The content node index or -1 iff not found.

Returns the index of the given content node.


public method Find2 → (2)

predicate in : PredicateDelegate<T>

[not-null]
The predicate.

index opt : int32 = 0

The start index.

returns → int32

The index of the found content node or -1 iff not found.

Finds a content node.

Insert


public method Insert → (2)

index in : int32

The insertion index. Will be clamped to the valid range.

element in : T

[not-null]
The content node.

Inserts the given content node at the specified index.

Remove


public method Remove → (2)

index in : int32

The removal index.

range opt : int32 = 0

Defines the index range of removed content nodes:
= 0 : [index..index[
< 0 : [0..index]
> 0 : [index..Content.Count[

returns → bool

true if all content nodes in the non-empty index range have been removed,
false if no content nodes have been removed because the index range is invalid or empty.

Removes the content node at the given index.

Public / Attributes

Content


public attribute Content → (get)

value : IVectorConst<T>

[not-null]
The content nodes.

The content nodes.

Protected / Constructors

Content​Node


protected constructor ContentNode → (1)

serialType in : ISerialTypeInfo

[not-null]
The serial ID.

Creates a new instance of ContentNode.

Protected / Attributes

content


protected readonly attribute content → (IVector<T>)

The content nodes.