Outlining State Persistence & Split-view Outlining

SyntaxEditor for WPF Forum

Posted 8 years ago by Erwin Liong
Version: 16.1.0631
Avatar

Hi Actipro,

 

I am looking at an earlier thread on Windows Form at http://www.actiprosoftware.com/community/thread/206/outlining-persistence

 

Question #1: Is there is a way to persist the outlining state? Saving it out to an xml file or something and then reloading it back into the document.

I have seen a getter for the rootNode property but not a setter method. If I were to have a custom handling to persist these outlininig state, how do I set it back to the document? And, of course, it would be best if Actipro provides a way to persist and load these persistence.

 

The outlining manager sits under the Document. From the SDI Editor (Inline) sample, if we were to split the window and perform a toggling of outlining state on one of the split view, the toggling is propagated to all views backed by the document.. Visual Studio have one state per split window.

One way to fix is having two documents for the split windows, but it will be too costly with keeping them in sync. The ideal case would be to have the Document holds one outlining manager which would then to have a 1-n relationship with an outlining state per split windows.

Question #2: Is there a way to better structure the outlining manager with the document? Or, is there already something available to use?

 

Cheers,

Erwin Liong

Comments (1)

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

Hi Erwin,

While we don't have a built-in way to persist outlining state, you could walk the IOutliningNode tree exposed via document.OutliningManager.RootNode and save the snapshot offset and IsCollapsed state into a tree structure of your own.  Then persist that.  To restore, you'd need to wait until the document's parse data updated the outlining and then walk your tree and again walk the RootNode tree at the same time.  Match up the nodes by offset and set their IsCollapsed state appropriately.  That sort of thing would probably work.

Sorry but we track the outlining node IsCollapsed state at the document outlining manager level instead of at the view level.  That can't really change without some major restructuring on our part.  There isn't really another way to have different views have different outlining expansion states for the same nodes.


Actipro Software Support

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