Beispiel #1
0
        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);
        }
Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #4
0
 public void Collapse(SUITreeViewNode node)
 {
     if (node.IsNullNode)
     {
         throw new SUIException("Cannot Collapse NULL TreeView node!");
     }
     ExpandNode(node, SUIMessage.TVE_COLLAPSE);
 }
Beispiel #5
0
 public void ExpandNode(SUITreeViewNode node)
 {
     if (node.IsNullNode)
     {
         throw new SUIException("Cannot expand NULL TreeView node!");
     }
     ExpandNode(node, SUIMessage.TVE_EXPAND);
 }
Beispiel #6
0
        public SUITreeViewNode FindChildNode(int index)
        {
            SUITreeViewNode node = FirstChildNode;

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

                node = node.NextSiblingNode;
                index--;
            }

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