One highly requested feature over the years has been to allow a way to customize or alter the highlighting styles used to syntax highlight text on the fly. Meaning the language uses its lexical parser to provide default highlighting, and you can override it before it is displayed.
With our design of SyntaxEditor for WPF, this is now possible.
The syntax highlighting model of SyntaxEditor for WPF by default uses lexical parsing from the current language to classify text. You can have your own custom classifiers attached that layer on top of the language results. You can examine the language’s classification results, and add your own classifications that override them. Let me illustrate…
|

SyntaxEditor with a custom classifier highlighting the word Actipro whenever it appears in documentation comments
|
In the screenshot above we have a C# language loaded. You can see keywords, comments, etc. highlighted normally. But note we also have a custom classifier attached. This classifier looks at the results of the language-based classification and if it sees the word Actipro within a documentation comment, it adds its own classification, which in turn makes that text red. So in the sample, you can see Actipro used a couple of other places in the text but it’s only highlighted for documentation comments.
|

Identifiers named Actipro also highlighted
|
In this next screenshot, you’ll notice the identifier named Actipro is also highlighted. In the QuickStart we have a CheckBox that has been checked, which told the custom classifier to look at identifiers too.
The neat thing about the classification system is that it’s virtualized and is only classifying text that displayed onscreen.
Anyhow the point of this feature is that now we have a way for you to intercept, and potentially completely alter how syntax highlighted text is presented to the end user.