AdornmentManager or DecorationAdornmentManagerBase?

SyntaxEditor for WPF Forum

Posted 13 years ago by Mick George - Senior Software Engineer, CNC Software, LLC
Version: 11.1.0542

We are developing an editor that includes a debugger very similar to the one in Visual Studio. Currently I am working on implementing debug stepping functionality and one of the items on my to do list is to highlight each lines text in the same way Visual Studio does while a user steps through a file.

I initially created a CurrentBreakLineAdornmentManager that implements AdornmentManagerBase<IEditorView> and it does work but there are some issues with it and because of this I am wondering if what I really need is a custom tag that implements DecorationAdornmentManagerBase<IEditorView, CustomTag>.

So my question is, what would be your recommended implementation based on the information I have given?

Comments (2)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Mick,

If you are just looking to do a simple background highlight of text, you don't need to create your own adornment manager since if you just have a classification tagger in place, SyntaxEditor can take care of the highlighting for you.

I'd recommend creating a class that inherits CollectionTagger<IClassificationTag> and registering that on your language with a tagger provider like in our adornments samples. If you have the tags from that tagger return an IClassificationType that is associated with an IHighlightingStyle, it will render the text using that style (including background specified by the style).

Thus no adornments are needed for this scenario.

Actipro Software Support

Posted 13 years ago by Mick George - Senior Software Engineer, CNC Software, LLC
Thank you for the information.
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.