Hello,
how can I access the lines of the Document?
I don't find a property like "Lines" (Collection of lines)
I only find the property Text in Document.Text
Thank you!
Hello,
how can I access the lines of the Document?
I don't find a property like "Lines" (Collection of lines)
I only find the property Text in Document.Text
Thank you!
Hi Matt,
Look at the document's CurrentSnapshot property. That is a mutable view of the document's text and has properties like Text and Lines on it.
Thank you!
Yes I can read a line with:
int lineToRead=10;
String lineContent= Document.CurrentSnapshot.Lines[lineToRead].Text;
But how can I write a line? "Text" has no setter.
Can you help me with that?
Thanks.
[Modified 11 years ago]
Hello,
I also need the information which lines of the document are visible on the screen:
First line that is visible.
Last line that is visible.
Thank you.
Hi Matt,
Take a look at the "SyntaxEditor / Text/Parsing Framework / Core Text Features / Text Changes and Operations" topic in the documentation that comes with SyntaxEditor. It describes the ways to create text changes (via document). You'd need to pass in the TextRange of the snapshot line to replace.
The editor view (editor.ActiveView.VisibleViewLines) gives you the list of IEditorViewLine objects that are currently visible. Note that view lines can contain partial snapshot lines (when word wrap is on) or more than one snapshot line (when there are collapsed outlining nodes).
Thank you.
Please log in to a validated account to post comments.