Find node where the caret is

SyntaxEditor for Windows Forms Forum

Posted 9 years ago by Miha Markic - Righthand
Avatar
Hi,

I am editing an XML document and want to find the node where caret is.
In other words I'd like to get the node <SomeNode> when the caret is inside the node name.
FindNodeRecursive(Caret.Offset) will find SomeNode only if caret is positioned after the closing bracket.

Miha Markic Righthand .net consulting and software development

Comments (2)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Miha,

Have you tried using the XmlSchemaResolver.GetContext method? That may help you more and gives you more info.


Actipro Software Support

Posted 9 years ago by Miha Markic - Righthand
Avatar
Excellent, I use GetContext() to get XmlContext and than FindNodeRecursive(XmlContext.InitializationTextRange.EndOffset+1) and voila, the proper node is selected.

Miha Markic Righthand .net consulting and software development

The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.