The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

DocumentVisitorBase Class

A base class implementing the IDocumentVisitor interface.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v19.1.Core.dll

Declaration

public abstract class DocumentVisitorBase :
    IDocumentVisitor
Public MustInherit Class DocumentVisitorBase
    Implements IDocumentVisitor
public abstract class DocumentVisitorBase :
    IDocumentVisitor
Public MustInherit Class DocumentVisitorBase
    Implements IDocumentVisitor

Remarks

Use the DocumentVisitorBase instead of your custom implementation to keep up with the actual state of the IDocumentVisitor interface in the event of possible modifications in the future.

Examples

MyVisitor is a DocumentVisitorBase class descendant which provides a method that processes DocumentText elements to do the following.

  • Enclose the bold text in asterisks
  • Return all characters without formatting
  • Replace the paragraph ends with newline symbols

Other document elements are skipped.

public class MyVisitor : DocumentVisitorBase
{
    readonly StringBuilder buffer;
    public MyVisitor() { this.buffer = new StringBuilder(); }
    protected StringBuilder Buffer { get { return buffer; } }
    public string Text { get { return Buffer.ToString(); } }

    public override void Visit(DocumentText text) {
        string prefix = (text.TextProperties.FontBold) ? "**" : "";
        Buffer.Append(prefix);
        Buffer.Append(text.Text);
        Buffer.Append(prefix);
    }
    public override void Visit(DocumentParagraphEnd paragraphEnd) {
        Buffer.AppendLine();
    }
}

Inheritance

Object
DocumentVisitorBase

Implements

See Also