private MethodViewModel FindMethodSemanticNode(MethodDeclaration method, NodeViewModel parent)
        {
            for (int i = 0; i < parent.ChildCount; i++)
            {
                var nodeViewModel = parent.GetChild(i);
                if (nodeViewModel.NodeType == NodeViewModelType.Method)
                {
                    var methodViewModel = (MethodViewModel)nodeViewModel;
                    if (object.ReferenceEquals(method, methodViewModel.Method))
                    {
                        return(methodViewModel);
                    }
                }
            }

            return(null);
        }
Beispiel #2
0
        public void ExpandAll(NodeViewModel node)
        {
            if (!node.HasChildren)
            {
                return;
            }

            if (!node.IsExpanded)
            {
                node.Expand();
            }

            for (int i = 0; i < node.ChildCount; i++)
            {
                ExpandAll(node.GetChild(i));
            }
        }