TextRangeProvider GetAttributeValue support needed

SyntaxEditor for WPF Forum

Posted 8 years ago by Xinen Lee
Version: 15.1.0624
Avatar

Hi

We need certain attributes such as Color and Squiggly status of our text ranges for Automation purposes. However the GetAttributeValue function is not implemented in TextRangeProvider. Moreover, TextRangeProvider is internal and can't be overridden in our assembly, so I can't do the implementation myself. 

What can I do?

Thanks!

Comments (10)

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

Hello,

A text range could potentially have mutiple overlapping colors/squiggle lines based on things like syntax highlighting, adornments, parse errors, etc.  What do you suggest we do here to expose it so that you can override things how you would like?


Actipro Software Support

Posted 8 years ago by Xinen Lee
Avatar

If you look at the ITextRangeProvider::GetAttributeValue() documentation in MSDN, it should allow the user to specify an attribute they want, e.g. UIA_FontNameAttributeId, UIA_IsItalicAttributeId, and it will return the value. We would probably have to specify some custom attribute for things like Squiggle status, Squiggle color etc. Adornments may be UIObjects of their own and not exposed as TextRanges.

Since different users of Syntax Editor may have different requirements, we will need different attributes from GetAttributeValue and it will be more flexible if we could override the TextRangeProvider. Can you make the TextRangeProvider class public so that we can do our own implementations?

Posted 8 years ago by Xinen Lee
Avatar

Another thing to look out for - in SyntaxEditorAutomationPeer, we would not be able to override the ITextRangeProvider implementations to give our own TextRangeProvider because they are implemented explicitly. They will need to be implemented implicitly to be overriden.

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

Hello,

We could probably make updates to have TextRangeProvider be public and have virtual methods instead.  As long as we had a virtual factory method on SyntaxEditorAutomationPeer such as CreateTextRangeProvider(SyntaxEditor editor, TextRange textRange) that created a TextRangeProvider so that you could override it with your own implementation, would that suffice for your needs?


Actipro Software Support

Posted 8 years ago by Xinen Lee
Avatar

Sounds ok, please keep us updated!

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

Hello,

We have made the changes mentioned in our previous reply for the next version.


Actipro Software Support

Posted 8 years ago by Xinen Lee
Avatar

Hi, may I know when will the next version be released? Still waiting for the changes.

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

Hello, it will be in the 2016.1 version, which should be out in the next several weeks.  This version has some very major updates and enhancements to certain products so we are having a longer-than-normal test period.


Actipro Software Support

Posted 8 years ago by Xinen Lee
Avatar

Hi, thanks for your good work on exposing the TextRangeProvider.

Now I'm trying to implement MoveEndpointByUnit in my derived class. It's supposed to change the end offset of the TextRange. However I'm unable to change the endpoint of TextRangeProvider.TextRange. I could keep and manage my own TextRange, but then I wouldn't be able to make use of the TextRangeProvider's implementations.

Could you make the TextRange settable so that derived classes can manipulate it?

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

Sure, we'll make it protected in the next build.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.