Interface INodeVisitor
Visitor interface for all types of filter framework editor specific nodes.
Namespace: SdlSdl.DesktopEditorEditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface INodeVisitor
Remarks
To take advantage of the visitor pattern, create a visitor class that implements this interface, instantiate an object, and pass it to AcceptNodeVisitor(INodeVisitor) on any INode instance.
The node will call back on the function in this interface that corresponds to its type.
This mechanism is very useful to avoid large switch/if/else tests for node types when processing nodes from collections (e.g. node containers). Not only do you avoid having to write these complex switches, the compiler will also tell you if the interface has been extended with new node types. That makes keeping the functionality up-to-date when the editor evolves much easier.
Methods
VisitBookmarkNode(IBookmarkNode)
Called by bookmark nodes.
Declaration
void VisitBookmarkNode(IBookmarkNode node)
Parameters
Type | Name | Description |
---|---|---|
IBookmarkNode | node |
VisitCommentContainerNode(ICommentContainerNode)
Called by comment container nodes.
Declaration
void VisitCommentContainerNode(ICommentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ICommentContainerNode | node |
VisitDocumentContainerNode(IDocumentContainerNode)
Called by document container nodes.
Declaration
void VisitDocumentContainerNode(IDocumentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IDocumentContainerNode | node |
VisitFileContainerNode(IFileContainerNode)
Called by file container nodes.
Declaration
void VisitFileContainerNode(IFileContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IFileContainerNode | node |
VisitLocationMarkerNode(ILocationMarkerNode)
Called by location marker nodes.
Declaration
void VisitLocationMarkerNode(ILocationMarkerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILocationMarkerNode | node |
VisitLockedContentContainerNode(ILockedContentContainerNode)
Called by locked content container nodes.
Declaration
void VisitLockedContentContainerNode(ILockedContentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILockedContentContainerNode | node |
VisitMarkerContainerNode(IOtherMarkerContainerNode)
Called by generic marker nodes.
Declaration
void VisitMarkerContainerNode(IOtherMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IOtherMarkerContainerNode | node |
VisitParagraphUnitContainerNode(IParagraphUnitContainerNode)
Called by ParagraphUnit container nodes.
Declaration
void VisitParagraphUnitContainerNode(IParagraphUnitContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IParagraphUnitContainerNode | node |
VisitPlaceholderTagNode(IPlaceholderTagNode)
Called by placeholder tag nodes.
Declaration
void VisitPlaceholderTagNode(IPlaceholderTagNode node)
Parameters
Type | Name | Description |
---|---|---|
IPlaceholderTagNode | node |
VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode)
Called by revision marker container nodes.
Declaration
void VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IRevisionMarkerContainerNode | node |
VisitSegmentContainerNode(ISegmentContainerNode)
Called by segment container nodes.
Declaration
void VisitSegmentContainerNode(ISegmentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ISegmentContainerNode | node |
VisitStartEndNode(IStartEndNode)
Called by start/end nodes.
Declaration
void VisitStartEndNode(IStartEndNode node)
Parameters
Type | Name | Description |
---|---|---|
IStartEndNode | node |
VisitTagPairContainerNode(ITagPairContainerNode)
Called by tag pair container nodes.
Declaration
void VisitTagPairContainerNode(ITagPairContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ITagPairContainerNode | node |
VisitTextNode(ITextNode)
Called by text nodes.
Declaration
void VisitTextNode(ITextNode node)
Parameters
Type | Name | Description |
---|---|---|
ITextNode | node |