Skip to main content
Box

LayoutVisitor.Visit(LayoutElement) Method

Dispatches the specified layout element to a special method of the Visitor class.

Namespace: DevExpress.XtraRichEdit.API.Layout

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

NuGet Package: DevExpress.RichEdit.Core

Declaration

public virtual void Visit(
    LayoutElement element
)

Parameters

Name Type Description
element LayoutElement

A LayoutElement descendant that is the element for which a specialized method is called.

Remarks

Call this method to traverse the layout tree starting with the specified node.

The Visit method calls the Accept method of the specified layout element, which in turn, calls the specialized method of the visitor instance. For example, the LayoutVisitor.Visit(LayoutPageArea) calls the LayoutPageArea.Accept method, which in turn, calls the VisitPageArea method which should be overridden in the LayoutVisitor custom descendant.

Example

View Example

private void DocumentLayout_DocumentFormatted(object sender, EventArgs e)
{

    richEditControl1.BeginInvoke(new Action(() =>
    {
        int pageCount = richEditControl1.DocumentLayout.GetFormattedPageCount();
        for (int i = 0; i < pageCount; i++)
        {
            MyDocumentLayoutVisitor visitor = new MyDocumentLayoutVisitor();
            visitor.Visit(richEditControl1.DocumentLayout.GetPage(i));
        }
    }));
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visit(LayoutElement) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also