Skip to main content

SubDocument.ApplySyntaxHighlight(List<SyntaxHighlightToken>) Method

Performs a batch update of text formatting for document ranges corresponding to specified tokens.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

void ApplySyntaxHighlight(
    List<SyntaxHighlightToken> tokens
)

Parameters

Name Type Description
tokens List<SyntaxHighlightToken>

A List<T><SyntaxHighlightToken,> collection containing tokens to apply, ordered by the SyntaxHighlightToken.Start value.

Remarks

Call the SubDocument.ApplySyntaxHighlight method within the ISyntaxHighlightService.Execute() method to enable syntax highlighting.

Refer to the How to: Highlight Document Syntax example (or How to: Highlight Document Syntax for WPF) for information on how to obtain the collection of SyntaxHighlightToken objects.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ApplySyntaxHighlight(List<SyntaxHighlightToken>) 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