Class ContentNodeIterator
Helper class to iterate over content nodes in the editor API.
Inherited Members
Namespace: Sdl.DesktopEditor.EditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
[CLSCompliant(false)]
public class ContentNodeIterator
Constructors
ContentNodeIterator(IAbstractContainerNode)
Limit iteration to the specified container, start at the first node in the container.
Declaration
public ContentNodeIterator(IAbstractContainerNode container)
Parameters
Type | Name | Description |
---|---|---|
IAbstractContainerNode | container | The bounding container |
ContentNodeIterator(IAbstractContainerNode, IAbstractNode)
Limit iteration to the specified container, start at a specified node (which should be in the container, but can be a sub-node).
Declaration
public ContentNodeIterator(IAbstractContainerNode container, IAbstractNode from)
Parameters
Type | Name | Description |
---|---|---|
IAbstractContainerNode | container | The bounding container |
IAbstractNode | from | The first node to start from. This is typically a node somewhere inside the container. |
ContentNodeIterator(IAbstractNode)
Start at the specified node. Iterate until the end of all available content, including parent nodes.
Declaration
public ContentNodeIterator(IAbstractNode from)
Parameters
Type | Name | Description |
---|---|---|
IAbstractNode | from | the position to start from, may or may not be a content node |
ContentNodeIterator(IAbstractNode, IAbstractContentNode)
Limit iteration to a specific end node. The iteration will stop at the upto node, which will not be returned as a content node.
Declaration
public ContentNodeIterator(IAbstractNode from, IAbstractContentNode upto)
Parameters
Type | Name | Description |
---|---|---|
IAbstractNode | from | The first node to start from. May or may not be a container. |
IAbstractContentNode | upto | The node at which to stop. Will not be part of the content iterated over, and must be after the from node to be effective. |
Fields
_Container
Container the search is limited to
Declaration
protected IAbstractContainerNode _Container
Field Value
Type | Description |
---|---|
IAbstractContainerNode |
_CurrentNode
The node currently selected
Declaration
protected IAbstractNode _CurrentNode
Field Value
Type | Description |
---|---|
IAbstractNode |
_EndNode
The node that will end iteration
Declaration
protected IAbstractContentNode _EndNode
Field Value
Type | Description |
---|---|
IAbstractContentNode |
Properties
Container
The container that iteration is limited to, or null
if none.
Declaration
public IAbstractContainerNode Container { get; set; }
Property Value
Type | Description |
---|---|
IAbstractContainerNode |
CurrentAbstractNode
The current node. This base implementation simply returns CurrentNode but derived implementations may need to return a more generic type.
Declaration
protected virtual IAbstractNode CurrentAbstractNode { get; }
Property Value
Type | Description |
---|---|
IAbstractNode |
CurrentNode
The current content node, or null
if none.
Declaration
public IAbstractContentNode CurrentNode { get; set; }
Property Value
Type | Description |
---|---|
IAbstractContentNode |
EndNode
The iteration stops when this node is reached. It is not returned as a current node.
Declaration
public IAbstractContentNode EndNode { get; set; }
Property Value
Type | Description |
---|---|
IAbstractContentNode |
Methods
GetNextContentNode(IAbstractNode)
Convenience method that allows easy access to the next content node.
This is exactly the same as creating a ContentNodeIterator,
calling Next
on it and taking the CurrentNode
.
Declaration
public static IAbstractContentNode GetNextContentNode(IAbstractNode from)
Parameters
Type | Name | Description |
---|---|---|
IAbstractNode | from | The content node to start iterating from. |
Returns
Type | Description |
---|---|
IAbstractContentNode | The next content node in the document, null if no node was found. |
Next()
Advance to the next content node.
Declaration
public bool Next()
Returns
Type | Description |
---|---|
System.Boolean |
|
Previous()
Backs the iterator to the previous node.
Declaration
public bool Previous()
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
Note that when backing the iterator does not check for stop conditions.