Outlining.RootNode invalid

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Stephan Ziep
Avatar
Hi again,

My Outling works fine, I can collapse/expand all my OutliningNodes. But when I programmaticly want to collapse certain Nodes in the PostParse() method of my SemanticParser, my Outlining RootNode.StartOffset is -1 and it says that there are no Ancestors. Although I can see plenty of them in my Editor.
The OutlingNodeActions are set just like in the Sample Application. What am I doing wrong?

Regards
Stephan Ziep

Comments (5)

Posted 18 years ago by Stephan Ziep
Avatar
Second question: can you give me a hint on how to persist Outlining information when swapping Documents or even between application sessions?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Stephan,

The RootNode is sort of an "invisible" node that contains any nodes that you actually see. Think of it like a root XML tag in an XML document. We need to have a single root, so it acts as a parent to all the real nodes in the document.

We haven't tried persisting outlining state between document sessions but I imagine doing a recursive traversal through the node tree and storing the start/end and collapsed states would work. Then when restoring, look for matches and set the collapsed states appropriately.


Actipro Software Support

Posted 18 years ago by Stephan Ziep
Avatar
Alright, stupid me :). It seems I mixed up ancestor with descendant. So to get the children of the RootNode I have to use 'GetEnumerator()', right?
The only problem is that my RootNode contains no Children. Count is 0 :(.
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If there are outlining nodes visible then they will be children of the RootNode. For instance if I do this in the sample app with the C# sample showing, I get a value of 1 (namespace node):
editor.Document.Outlining.RootNode.Count


Actipro Software Support

Posted 18 years ago by Adam Dickinson
Avatar
No, that's not the case (at least in ver 3.1.203 .NET 1.1). RootNode always has 0 for Count and no children, no matter how many nodes there actually are. GetEnumerator doesn't iterate over anything. Please advise.

UPDATE:
Ah, I see now. The outlining must be being cleared when we do a lexical parse, then filled when we do a semantic parse. I'm doing a full reparse so by the time we call PreParse(...), the RootNode is empty. I just need to save my OutliningNode info sooner.

[Modified at 06/01/2006 01:15 PM]
The latest build of this product (v24.1.0) 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.