Index out of range when recursively collapsing or expanding IOutliningNodes?

SyntaxEditor for WPF Forum

Posted 3 years ago by James Kester - Metafile Information Systems, Inc.
Version: 20.1.1
Avatar

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);
        }

    }
}

Comments (1)

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

Hi James,

Odd, we haven't seen that before.  Can you reproduce this in a new simple sample project that you can sent to our support address so that we can debug it?  Please reference this thread in your e-mail and remove the bin/obj folders so that it doesn't get spam blocked.  Thanks!


Actipro Software Support

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