public SUITreeViewNode FindChildNode(string text, bool isRegex)
        {
            SUITreeViewNode node = FirstChildNode;
            Regex           reg  = null;

            if (isRegex)
            {
                reg = new Regex(text);
            }

            while (!node.IsNullNode)
            {
                if (isRegex)
                {
                    if (reg.IsMatch(node.Text))
                    {
                        break;
                    }
                }
                else
                {
                    if (node.Text.Equals(text))
                    {
                        break;
                    }
                }

                node = node.NextSiblingNode;
            }

            return(node);
        }
Exemple #2
0
        public SUITreeViewNode FindTopLevelNode(string text, bool isRegex)
        {
            SUITreeViewNode node = null;
            Regex           reg  = null;

            if (isRegex)
            {
                reg = new Regex(text);
            }

            // Get root node.
            node = GetNextItem(IntPtr.Zero, SUIMessage.TVGN_ROOT);

            // Iterate all top level nodes to search target node.
            while (!node.IsNullNode)
            {
                if (isRegex)
                {
                    if (reg.IsMatch(node.Text))
                    {
                        break;
                    }
                }
                else
                {
                    if (node.Text.Equals(text))
                    {
                        break;
                    }
                }

                node = node.NextSiblingNode;
            }
            return(node);
        }
Exemple #3
0
 public void SelectNode(SUITreeViewNode node)
 {
     if (node.IsNullNode)
     {
         throw new SUIException("Cannot select NULL TreeView node!");
     }
     SUIWinAPIs.SendMessage(WindowHandle, SUIMessage.TVM_SELECTITEM, new IntPtr(SUIMessage.TVGN_CARET), node.hItem);
 }
Exemple #4
0
 public void Collapse(SUITreeViewNode node)
 {
     if (node.IsNullNode)
     {
         throw new SUIException("Cannot Collapse NULL TreeView node!");
     }
     ExpandNode(node, SUIMessage.TVE_COLLAPSE);
 }
Exemple #5
0
 public void ExpandNode(SUITreeViewNode node)
 {
     if (node.IsNullNode)
     {
         throw new SUIException("Cannot expand NULL TreeView node!");
     }
     ExpandNode(node, SUIMessage.TVE_EXPAND);
 }
        public SUITreeViewNode FindChildNode(int index)
        {
            SUITreeViewNode node = FirstChildNode;

            while (!node.IsNullNode)
            {
                if (index == 0)
                {
                    break;
                }

                node = node.NextSiblingNode;
                index--;
            }

            return(node);
        }
Exemple #7
0
        public SUITreeViewNode FindTopLevelNode(int index)
        {
            SUITreeViewNode node = null;

            // Get root node.
            node = GetNextItem(IntPtr.Zero, SUIMessage.TVGN_ROOT);

            // Iterate all top level nodes to search target node.
            while (!node.IsNullNode)
            {
                if (index == 0)
                {
                    break;
                }

                node = node.NextSiblingNode;
                index--;
            }
            return(node);
        }
Exemple #8
0
        public SUITreeViewNode FindSelectedNode(SUITreeViewNode parentNode)
        {
            SUITreeViewNode startNode = null;

            if (parentNode == null)
            {
                startNode = Root;
            }
            else
            {
                startNode = parentNode.FirstChildNode;
            }

            // Iterate all nodes on the same level.
            while (!startNode.IsNullNode)
            {
                if (startNode.IsSelected)
                {
                    return(startNode);
                }
                else
                {
                    //Depth first recursive search.
                    SUITreeViewNode foundNode = FindSelectedNode(startNode);
                    if (!foundNode.IsNullNode)
                    {
                        return(foundNode);
                    }
                }

                startNode = startNode.NextSiblingNode;
            }
            TVITEM item = new TVITEM();

            item.hItem = IntPtr.Zero;
            return(new SUITreeViewNode(this, item));
        }
Exemple #9
0
 public void SelectNode(SUITreeViewNode node)
 {
     if (node.IsNullNode)
         throw new SUIException("Cannot select NULL TreeView node!");
     SUIWinAPIs.SendMessage(WindowHandle, SUIMessage.TVM_SELECTITEM, new IntPtr(SUIMessage.TVGN_CARET), node.hItem);
 }
Exemple #10
0
        public SUITreeViewNode FindSelectedNode(SUITreeViewNode parentNode)
        {
            SUITreeViewNode startNode = null;
            if (parentNode == null)
                startNode = Root;
            else
                startNode = parentNode.FirstChildNode;

            // Iterate all nodes on the same level.
            while (!startNode.IsNullNode)
            {
                if (startNode.IsSelected)
                {
                    return startNode;
                }
                else
                {
                    //Depth first recursive search.
                    SUITreeViewNode foundNode = FindSelectedNode(startNode);
                    if (!foundNode.IsNullNode)
                        return foundNode;
                }

                startNode = startNode.NextSiblingNode;
            }
            TVITEM item = new TVITEM();
            item.hItem = IntPtr.Zero;
            return new SUITreeViewNode(this, item);
        }
Exemple #11
0
 public void ClickToSelectNode(SUITreeViewNode node)
 {
     SelectNode(node);
     SUIMouse.MouseClick(this, node.Rectangle.X + 5, node.Rectangle.Y + 5);
 }
Exemple #12
0
 public void ExpandNode(SUITreeViewNode node)
 {
     if (node.IsNullNode)
         throw new SUIException("Cannot expand NULL TreeView node!");
     ExpandNode(node, SUIMessage.TVE_EXPAND);
 }
Exemple #13
0
 public void Collapse(SUITreeViewNode node)
 {
     if (node.IsNullNode)
         throw new SUIException("Cannot Collapse NULL TreeView node!");
     ExpandNode(node, SUIMessage.TVE_COLLAPSE);
 }
Exemple #14
0
 public void ExpandNode(SUITreeViewNode node)
 {
     suiTreeView.ExpandNode(node);
 }
Exemple #15
0
 internal void ExpandNode(SUITreeViewNode node, int flag)
 {
     SUIWinAPIs.PostMessage(WindowHandle, SUIMessage.TVM_EXPAND, new IntPtr(flag), node.hItem);
     SUISleeper.Sleep(500);
 }
Exemple #16
0
 public void Collapse(SUITreeViewNode node)
 {
     suiTreeView.Collapse(node);
 }
Exemple #17
0
 void ExpandNode(SUITreeViewNode node, int flag)
 {
     suiTreeView.ExpandNode(node, flag);
 }
Exemple #18
0
 public SUITreeViewNode FindSelectedNode(SUITreeViewNode parentNode)
 {
     return suiTreeView.FindSelectedNode(parentNode);
 }
Exemple #19
0
 public void ClickToSelectNode(SUITreeViewNode node)
 {
     suiTreeView.ClickToSelectNode(node);
 }
Exemple #20
0
 internal void ExpandNode(SUITreeViewNode node, int flag)
 {
     SUIWinAPIs.PostMessage(WindowHandle, SUIMessage.TVM_EXPAND, new IntPtr(flag), node.hItem);
     SUISleeper.Sleep(500);
 }
Exemple #21
0
 public void ClickToSelectNode(SUITreeViewNode node)
 {
     SelectNode(node);
     SUIMouse.MouseClick(this, node.Rectangle.X + 5, node.Rectangle.Y + 5);
 }
Exemple #22
0
 public void SelectNode(SUITreeViewNode node)
 {
     suiTreeView.SelectNode(node);
 }