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