I am trying to implement the equivalent of Visual Studio's
Toggle Outlining Expansion
Toggle All Outlining
commands.
For the first one I can use:
OutliningNode node = Document.Outlining.RootNode.FindNodeRecursive(Caret.Offset);
if (node != null) node.ToggleExpansion();
But I have not found an obvious way to handle 'Toggle All Outlining'.
I can loop through the children of the RootNode and toggle each ones outlining state, but that only handles the first level.
Do I really have to recursively go through every level and handle each node separately?
I was hoping there would be a method somewhere that can toggle all nodes to the specified state. (Expanded or Collapsed)
If I have to handle each node manualy is there a way to simply get all outline nodes without reguard to their heirachy?