Exemplo n.º 1
0
        }// onExpand

        internal void LazyExpand()
        {
            // Expand all non-root nodes on another thread to free
            // up the main thread so it can do what it needs to do when
            // starting up
            if (Cookie != CNodeManager.RootNodeCookie && !m_fInsertedChildrenOnExpand)
            {
                ArrayList al = new ArrayList();
                al.Add(Cookie);

                // We need to expand all the children in a non-recursive way.
                // We'll use a queue approach
                while (al.Count > 0)
                {
                    CNode node = CNodeManager.GetNode((int)al[0]);

                    // First "expand" this node so it can receive children
                    CNodeManager.ExpandNodeNamespace(node.HScopeItem);

                    node.InsertChildren(node.HScopeItem);

                    node.m_fInsertedChildrenOnExpand = true;

                    // Push this node's children into our queue
                    for (int i = 0; i < node.NumChildren; i++)
                    {
                        al.Add(node.Child[i]);
                    }

                    // Remove this node we're working on
                    al.RemoveAt(0);
                }

                // All done with the initial slew of nodes
                m_fInitialCreationDone = true;
                // Let the node manager know, in case there's something else we want to do
                CNodeManager.FinishedNodeLoading();
            }
        }// LazyExpand