Class PlainTextExtractionVisitor
Visitor implementation that can be used to build a plain text representation from editor nodes.
Inheritance
Inherited Members
Namespace: Sdl.DesktopEditor.EditorApi.Implementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public class PlainTextExtractionVisitor : INodeVisitor
Remarks
Typically used together with a Content
To use, call Visit
Constructors
PlainTextExtractionVisitor()
Use a new string builder for the result.
Declaration
public PlainTextExtractionVisitor()
Remarks
Typically used together with a Content
To use, call Visit
PlainTextExtractionVisitor(StringBuilder)
Append text to an existing string builder.
Declaration
public PlainTextExtractionVisitor(StringBuilder appendResultTo)
Parameters
Type | Name | Description |
---|---|---|
String |
appendResultTo |
Remarks
Typically used together with a Content
To use, call Visit
Properties
AppendLineBreakForSegments
When true
a line break will be appended for every segment end
Used when copying
When false
no text is appended for segments.
Declaration
public bool AppendLineBreakForSegments { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Typically used together with a Content
To use, call Visit
AppendTextEquivalentForPlaceholders
When true
placeholder tags will yield text
corresponding to their Textfalse
no text is appended for placeholder tags.
Declaration
public bool AppendTextEquivalentForPlaceholders { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Typically used together with a Content
To use, call Visit
Result
The resulting string.
Declaration
public StringBuilder Result { get; set; }
Property Value
Type | Description |
---|---|
String |
Remarks
Typically used together with a Content
To use, call Visit
Methods
VisitBookmarkNode(IBookmarkNode)
Do nothing.
Declaration
public void VisitBookmarkNode(IBookmarkNode node)
Parameters
Type | Name | Description |
---|---|---|
IBookmark |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitCommentContainerNode(ICommentContainerNode)
Do nothing.
Declaration
public void VisitCommentContainerNode(ICommentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IComment |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitCommentMarker(ICommentMarker)
Do nothing.
Declaration
public void VisitCommentMarker(ICommentMarker commentMarker)
Parameters
Type | Name | Description |
---|---|---|
IComment |
commentMarker |
Remarks
Typically used together with a Content
To use, call Visit
VisitDocumentContainerNode(IDocumentContainerNode)
Do nothing.
Declaration
public void VisitDocumentContainerNode(IDocumentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IDocument |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitFileContainerNode(IFileContainerNode)
Do nothing.
Declaration
public void VisitFileContainerNode(IFileContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IFile |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitLocationMarker(ILocationMarker)
Do nothing.
Declaration
public void VisitLocationMarker(ILocationMarker location)
Parameters
Type | Name | Description |
---|---|---|
ILocation |
location |
Remarks
Typically used together with a Content
To use, call Visit
VisitLocationMarkerNode(ILocationMarkerNode)
Do nothing.
Declaration
public void VisitLocationMarkerNode(ILocationMarkerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILocation |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitLockedContent(ILockedContent)
Visit all locked items.
Declaration
public void VisitLockedContent(ILockedContent lockedContent)
Parameters
Type | Name | Description |
---|---|---|
ILocked |
lockedContent |
Remarks
Typically used together with a Content
To use, call Visit
VisitLockedContentContainerNode(ILockedContentContainerNode)
Visit the locked content.
Declaration
public void VisitLockedContentContainerNode(ILockedContentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ILocked |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitMarkerContainerNode(IOtherMarkerContainerNode)
Do nothing.
Declaration
public void VisitMarkerContainerNode(IOtherMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IOther |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitNode(IAbstractContentNode)
Cast the node to a framework node and visit it.
Declaration
public void VisitNode(IAbstractContentNode node)
Parameters
Type | Name | Description |
---|---|---|
IAbstract |
node |
Remarks
This approach is convenient when used with the content node iterator.
VisitOtherMarker(IOtherMarker)
Do nothing.
Declaration
public void VisitOtherMarker(IOtherMarker marker)
Parameters
Type | Name | Description |
---|---|---|
IOther |
marker |
Remarks
Typically used together with a Content
To use, call Visit
VisitParagraphUnitContainerNode(IParagraphUnitContainerNode)
Do nothing.
Declaration
public void VisitParagraphUnitContainerNode(IParagraphUnitContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IParagraph |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitPlaceholderTag(IPlaceholderTag)
Append text for the placeholder, depending on settings.
Declaration
public virtual void VisitPlaceholderTag(IPlaceholderTag tag)
Parameters
Type | Name | Description |
---|---|---|
IPlaceholder |
tag |
Remarks
Typically used together with a Content
To use, call Visit
VisitPlaceholderTagNode(IPlaceholderTagNode)
Append text for the placeholder, depending on settings.
Declaration
public void VisitPlaceholderTagNode(IPlaceholderTagNode node)
Parameters
Type | Name | Description |
---|---|---|
IPlaceholder |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitRevisionMarker(IRevisionMarker)
Do nothing.
Declaration
public void VisitRevisionMarker(IRevisionMarker revisionMarker)
Parameters
Type | Name | Description |
---|---|---|
IRevision |
revisionMarker |
Remarks
Typically used together with a Content
To use, call Visit
VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode)
Do nothing.
Declaration
public void VisitRevisionMarkerContainerNode(IRevisionMarkerContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
IRevision |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitSegment(ISegment)
Do nothing here: since the typical use case for this class is to be used with
a Content
Declaration
public void VisitSegment(ISegment segment)
Parameters
Type | Name | Description |
---|---|---|
ISegment | segment |
Remarks
Typically used together with a Content
To use, call Visit
VisitSegmentContainerNode(ISegmentContainerNode)
Do nothing.
Declaration
public void VisitSegmentContainerNode(ISegmentContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ISegment |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitStartEndNode(IStartEndNode)
Do nothing unless we have a segment container node: if we do we may want to insert a line break.
Declaration
public void VisitStartEndNode(IStartEndNode node)
Parameters
Type | Name | Description |
---|---|---|
IStart |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitTagPair(ITagPair)
Do nothing.
Declaration
public void VisitTagPair(ITagPair tagPair)
Parameters
Type | Name | Description |
---|---|---|
ITag |
tagPair |
Remarks
Typically used together with a Content
To use, call Visit
VisitTagPairContainerNode(ITagPairContainerNode)
Do nothing.
Declaration
public void VisitTagPairContainerNode(ITagPairContainerNode node)
Parameters
Type | Name | Description |
---|---|---|
ITag |
node |
Remarks
Typically used together with a Content
To use, call Visit
VisitText(IText)
Append text to the result.
Declaration
public void VisitText(IText text)
Parameters
Type | Name | Description |
---|---|---|
IText | text |
Remarks
Typically used together with a Content
To use, call Visit
VisitTextNode(ITextNode)
Append text to the result.
Declaration
public void VisitTextNode(ITextNode node)
Parameters
Type | Name | Description |
---|---|---|
IText |
node |
Remarks
Typically used together with a Content
To use, call Visit