views:

41

answers:

1

Hello,

I am developing an extension to add graphics around code (text).

I've searched around and came up with only one other post refering to IWpfTextView (and related) interfaces.

What i want is to "markup" the code with (ex) arrows, boxes and lines. I've read through the mdsn and it seems scrolling up and down does a complete redraw and the Top coordinate changes. There's also http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.text.editor.aspx But no complete text on the matter.

Are there any examples on the subject? Is this a supported scenario?

+2  A: 

Yes, this is supported.

In the SDK, there is a project template for "Text Relative Adornment", which shows the general idea. That template places an adornment underneath text, like a highlight, but you can place text-relative adornments anywhere on the view ("text-relative" just means that the adornment scrolls with the text).

For examples, you can start with this AgentBadgeVisualManager.cs file, which is for displaying a user "badge" off to the right of a piece of text.

I recently wrote a blog article about text relative adornments, though it's more of "best practices" and less of "here is the code you need to put an arrow on the editor".

Noah Richards
Thanks Noah! Top gun!
basilmir