Class CopyFragmentVisitor
An INodeVisitor implementation that works through the nodes and copies all nodes to the document fragment in the same structure.
Implements
Inherited Members
Namespace: SdlSdl.DesktopEditorEditorApiImplementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public class CopyFragmentVisitor : INodeVisitor
Constructors
CopyFragmentVisitor(IDocumentFragment)
Visits all child nodes and copies them to the IFrameworkDocumentFragment keeping the same structure.
Declaration
public CopyFragmentVisitor(IDocumentFragment fragment)
Parameters
Type | Name | Description |
---|---|---|
IDocumentFragment | fragment | The document fragment to copy the nodes to. |
Properties
Fragment
Readonly property which returns the processed document fragment.
Declaration
public IDocumentFragment Fragment { get; }
Property Value
Type | Description |
---|---|
IDocumentFragment |
Methods
VisitBookmarkNode(IBookmarkNode)
Visits a bookmark node and adds it to the last parent node processed.
Declaration
public virtual void VisitBookmarkNode(IBookmarkNode node)
Parameters
Type | Name | Description |
---|---|---|
IBookmarkNode | node |
VisitChildren(IAbstractContainerNode)
Iterates over all children in the container and visits them.
Declaration
protected void VisitChildren(IAbstractContainerNode containerNode)
Parameters
Type | Name | Description |
---|---|---|
IAbstractContainerNode | containerNode |
VisitCommentContainerNode(ICommentContainerNode)
Visits a comment container node and all its children.
Declaration
public virtual void VisitCommentContainerNode(ICommentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ICommentContainerNode | node |
VisitContainerNode(IAbstractContainerNode, IChangeableContainerNode)
Visits a container node.
Declaration
protected void VisitContainerNode(IAbstractContainerNode oldContainerNode, IChangeableContainerNode newContainerNode)
Parameters
Type | Name | Description |
---|---|---|
IAbstractContainerNode | oldContainerNode | The original container node to visit. |
IChangeableContainerNode | newContainerNode | The container node to copy all content into (by visiting all children). |
VisitDocumentContainerNode(IDocumentContainerNode)
Document container nodes are ignored.
Declaration
public virtual void VisitDocumentContainerNode(IDocumentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IDocumentContainerNode | node |
VisitFileContainerNode(IFileContainerNode)
File container nodes are ignored.
Declaration
public virtual void VisitFileContainerNode(IFileContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IFileContainerNode | node |
VisitLocationMarkerNode(ILocationMarkerNode)
Visits a location marker node and adds it to the last parent processed.
Declaration
public virtual void VisitLocationMarkerNode(ILocationMarkerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILocationMarkerNode | node |
VisitLockedContentContainerNode(ILockedContentContainerNode)
Visits a locked content node and adds it to the last parent processed.
Declaration
public virtual void VisitLockedContentContainerNode(ILockedContentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILockedContentContainerNode | node |
VisitMarkerContainerNode(IOtherMarkerContainerNode)
Visits a marker container node and all its children.
Declaration
public virtual void VisitMarkerContainerNode(IOtherMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IOtherMarkerContainerNode | node |
VisitParagraphUnitContainerNode(IParagraphUnitContainerNode)
Paragraph unit container nodes are ignored.
Declaration
public virtual void VisitParagraphUnitContainerNode(IParagraphUnitContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IParagraphUnitContainerNode | node |
VisitPlaceholderTagNode(IPlaceholderTagNode)
Visits a placeholder tag node and adds it to the last parent processed.
Declaration
public virtual void VisitPlaceholderTagNode(IPlaceholderTagNode node)
Parameters
Type | Name | Description |
---|---|---|
IPlaceholderTagNode | node |
VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode)
Visits a revision marker container node and all its children.
Declaration
public virtual void VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IRevisionMarkerContainerNode | node |
VisitSegmentContainerNode(ISegmentContainerNode)
Visits a segment container node and all child nodes.
Declaration
public virtual void VisitSegmentContainerNode(ISegmentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ISegmentContainerNode | node |
VisitStartEndNode(IStartEndNode)
StartEnd nodes are ignored.
Declaration
public virtual void VisitStartEndNode(IStartEndNode node)
Parameters
Type | Name | Description |
---|---|---|
IStartEndNode | node |
VisitTagPairContainerNode(ITagPairContainerNode)
Visits a tag pair container node and all its children.
Declaration
public virtual void VisitTagPairContainerNode(ITagPairContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ITagPairContainerNode | node |
VisitTextNode(ITextNode)
Vists a text node and adds it to the last parent node processed.
Declaration
public virtual void VisitTextNode(ITextNode node)
Parameters
Type | Name | Description |
---|---|---|
ITextNode | node |