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.v24.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
Declaration
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
Private Sub DocumentLayout_DocumentFormatted(ByVal sender As Object, ByVal e As EventArgs)
richEditControl1.BeginInvoke(New Action(Sub()
Dim pageCount As Integer = richEditControl1.DocumentLayout.GetFormattedPageCount()
For i As Integer = 0 To pageCount - 1
Dim visitor As New MyDocumentLayoutVisitor()
visitor.Visit(richEditControl1.DocumentLayout.GetPage(i))
Next i
End Sub))
End Sub
Related GitHub Examples
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.