Posted 4 years ago by Davide Fiore
Version: 19.1.0684

Hello, Im trying to implement an editor with multidocument support. I understand that I can many documents open, but Im looking to understand how to visualize all of them in a tabcontroller. I tried to create a copy of the "original" SyntaxEditor control in the codebehind and reassign the bindings and events, but it doesen't work properly. Also doing in this way would result in having many SyntaxEditor controls with one document assigned to eachone...Im sure there is a better way but I cant see it now, can you help me?


Comments (2)

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

Hi Davide,

You can think of SyntaxEditor like a much more powerful version of a TextBox.  If you are editing multiple documents, where each document should be a tab in some kind of MDI UI, then having a separate SyntaxEditor instance for each tab is fine and probably expected.  

Most SyntaxEditor events that are view/document/language related have event sink language services that can be registered on the language.  That lets you encapsulate all code related to your syntax language in the language itself instead of having to handle SyntaxEditor control events.  You might run into a couple scenarios where you do need to handle SyntaxEditor events for interacting with external UI though, like to update a status bar.

SyntaxEditor also supports a single SyntaxEditor instance swapping in and out documents.  You can assign the current EditorDocument instance you want edited to the SyntaxEditor.Document property.  But based on what you said, I don't think that's what you're after.

If you have any further questions, please give some more detail and we'll get back to you.

Actipro Software Support

Posted 4 years ago by Davide Fiore

Ok thanks for the clear answer. 

The latest build of this product (v24.1.1) 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.