Persisting modified text into some file

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Pankaj Lathiya
Version: 4.0.0253
Avatar
Hi,
I am evaluating your product and I am facing one problem with persisting modified(e.g. change in the background color,change in font) text of the document.

Detailed explanation of the problem is as follows:
If I select some text and clicks “Add” button [it is the functionality of the application] then application highlights the selected text using span indicator and even it shows the Glyph. Now the problem is, I want to store this modified text/document into the file and next time if I open the application I want to see the modified text in the control. I tried saving the text into html file and rtf file but I was not able to retrieve the modified text. Please help me with this and if you have any sample please provide that too.

Comments (4)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Pankaj,

Did you just want the indicators visually saved into the exported HTML/RTF or do you want the indicators reloaded into SyntaxEditor again when you reload the file in SyntaxEditor?


Actipro Software Support

Posted 12 years ago by Pankaj Lathiya
Avatar
Hi,
Yes, i want to reload the previously modified text and the indicator again in the syntaxEditor control. is it possible to do this and How?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Pankaj,

Yes but we don't have an automated way to do it. Since indicators are not related to the text content you have to store them separately.

So what you would do is loop through each of your span indicators in the SpanIndicatorLayer and persist the TextRange of each indicator to some storage mechanism, such as a separate file. Maybe make a binary file that you output the TextRanges to. Then when your code file gets reloaded, you would open the file that has the indicator ranges and for each range, re-add a span indicator with that range. It should be fairly easy to implement that on your end.


Actipro Software Support

Posted 12 years ago by Pankaj Lathiya
Avatar
Heh Thanks for quick reply.

Let me try what you have suggested and I will get back to you if I need anything else.
Thanks again.
The latest build of this product (v2018.1 build 0341) was released 7 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.