Change color only for user defined function/class identifier

SyntaxEditor for WPF Forum

Posted 3 years ago by Vadim Tsedrik
Version: 21.1.2


could you help me to proceed with the following problem?

I need to change the color of the identifier of any user-defined functions and classes.


Comments (1)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA


The way to override default syntax highlighting from a lexer in SyntaxEditor is to use classification tags.  You effectively make a new IClassificationType that is associated with an IHighlightingStyle in the style registry.  The style would have an alternate foreground color to be used for the text.  Then you make a tagger that applies that IClassificationType over various appropriate text ranges that should receive that alternate foreground color.  Some of our adornments-related samples show the concept of classification types.  The tricky part of the whole thing is knowing where those identifiers are, so that you can tag the text ranges.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.