How to use Syntax editor without using control

SyntaxEditor for WPF Forum

Posted 4 years ago by Ondrej Piza
Version: 15.1.0624
Avatar

Hi,

 

is it possible to use Syntax editor features without using it's control? 

Problem, I have is, that I would like to use the syntax editor in many instances for a very small pieces of code. This scenario however leads to more memory consumption.

For example, think of it as an tree or flow of code pieces, with some nodes having pieces of code.

The best scenario would be to have RichTextBoxes with text and every edit changes do on single SyntaxEditor instance. The problem si, that formatted text is not usable for RichTextBox.

Is there a workaround? How to get hihglighted code to the RichTextBox or how to share a single instace of SyntaxEditor accross the whole ModelView ?

Thank you for any advice

[Modified 4 years ago]

Comments (1)

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

Hello,

You can use a document independently of a SyntaxEditor, and then swap documents in and out of a single SyntaxEditor instance.  So that means that if you created an EditorDocument for each node that has code (each document should be set up to share the same SyntaxLanguage instance too) and a single SyntaxEditor instance, whenever you selected a different node, you could set the SyntaxEditor.Document property to that node's document instance.  The node's code would then show up in the single SyntaxEditor instance.  Is that what you are after?


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.