
I have the following 2 funtions to expand all child nodes of a given node, and one to collapse all nodes. Both of these seem to throw an intermitint exception on the line "child.IsCollapsed = false/true"
'Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index'
It seems every time it happens its setting IsCollapsed to false, when it already is equal to false.
ver 19.1.684
private void ExpandChildNodes(IOutliningNode node)
{
if(node.Count > 0)
{
foreach(IOutliningNode child in node)
{
child.IsCollapsed = false;
ExpandChildNodes(child);
}
}
}
private void CollapseAllNodes(IOutliningNode node)
{
if (node.Count > 0)
{
foreach (IOutliningNode child in node)
{
child.IsCollapsed = true;
CollapseAllNodes(child);
}
}
}