Esempio n. 1
0
        public bool SelectNode(ISearchNodeCriteria criteria)
        {
            foreach (TreeNode treeNode in treeNodes.Nodes)
            {
                INode node = treeNode.Tag as INode;

                if (criteria.IsMatch(treeNode))
                {
                    if (!SelectedNodeChange(treeNode))
                    {
                        return(false);
                    }

                    treeNodes.SelectedNode = treeNode;
                    treeNode.Expand();
                    // treeNodes.Focus();

                    ShowNodeRepresentation(node);

                    return(true);
                }
            }

            foreach (TreeNode treeNode in currentlySelectedNode.Nodes)
            {
                INode node = treeNode.Tag as INode;

                if (criteria.IsMatch(treeNode))
                {
                    if (!SelectedNodeChange(treeNode))
                    {
                        return(false);
                    }

                    treeNodes.SelectedNode = treeNode;
                    treeNode.Expand();
                    //treeNodes.Focus();

                    ShowNodeRepresentation(node);

                    return(true);
                }
            }



            return(false);
        }
Esempio n. 2
0
        public bool SelectNode(ISearchNodeCriteria criteria)
        {
            foreach (TreeNode treeNode in treeNodes.Nodes)
            {
                INode node = treeNode.Tag as INode;

                if (criteria.IsMatch(treeNode))
                {
                    if (!SelectedNodeChange(treeNode))
                        return false;

                    treeNodes.SelectedNode = treeNode;
                    treeNode.Expand();
                    // treeNodes.Focus();

                    ShowNodeRepresentation(node);

                    return true;
                }
            }

            foreach (TreeNode treeNode in currentlySelectedNode.Nodes)
            {
                INode node = treeNode.Tag as INode;

                if (criteria.IsMatch(treeNode))
                {
                    if (!SelectedNodeChange(treeNode))
                        return false;

                    treeNodes.SelectedNode = treeNode;
                    treeNode.Expand();
                    //treeNodes.Focus();

                    ShowNodeRepresentation(node);

                    return true;
                }
            }

            return false;
        }