Exemplo n.º 1
0
 public override void OnNotifyBeforeExpand(CommonTools.Node node, bool expanding)
 {
     if (node.Nodes.Count == 0)
     {
         AddPath(GetPath(node), node);
     }
 }
Exemplo n.º 2
0
 void AddPath(string originalPath, CommonTools.Node parent)
 {
     if (IsIncluded(eIncludeTypes.Directory))
     {
         string[] directories = Directory.GetDirectories(originalPath);
         foreach (string path in directories)
         {
             if (CanAdd(path) == false)
             {
                 continue;
             }
             AddNode(path, parent, true);
         }
     }
     if (IsIncluded(eIncludeTypes.File))
     {
         string[] files = Directory.GetFiles(originalPath);
         foreach (string path in files)
         {
             if (CanAdd(path) == false)
             {
                 continue;
             }
             AddNode(path, parent, false);
         }
     }
 }
Exemplo n.º 3
0
        private void BuildTreeViewMenu(CommonTools.Node treeListNode)
        {
            behaviorTreeCMS.Items.Clear();

            var root = _controller.Data.Root.RootNode;
            var node = treeListNode != null ? treeListNode.Tag as Node : root;

            if (node is Composite || (node is Decorator && node.Nodes.Count == 0))
            {
                foreach (var type in _nodeTypes)
                {
                    var nodeName = Node.GetName(type);
                    var nodeType = Node.GetType(type);

                    var items = GetMenuItem(behaviorTreeCMS.Items, nodeType);
                    if (items == null)
                    {
                        items = AddMenuItem(nodeType, null, null);
                    }

                    AddMenuItem(items, nodeName, type, t => AddNewNode(t, node));
                }
            }

            if (node != root)
            {
                AddMenuItem("Remove Node", null, t => node.Remove());
            }
        }
Exemplo n.º 4
0
        protected override object GetData(CommonTools.Node node, CommonTools.TreeListColumn column)
        {
            object data = base.GetData(node, column);

            if (data != null)
            {
                return(data);
            }

            if (column.Fieldname == "childCount")
            {
                if (node.HasChildren)
                {
                    return(node.Nodes.Count);
                }
                return("<none>");
            }
            if (column.Fieldname == "visibleCount")
            {
                if (node.HasChildren)
                {
                    return(node.VisibleNodeCount);
                }
                return("<none>");
            }
            return(string.Empty);
        }
Exemplo n.º 5
0
        protected override CommonTools.TreeList.TextFormatting GetFormatting(CommonTools.Node node, CommonTools.TreeListColumn column)
        {
            CommonTools.TreeList.TextFormatting format = new CommonTools.TreeList.TextFormatting(column.CellFormat);
            int testvalue = (node.NodeIndex & 0x01);

            testvalue |= (column.VisibleIndex & 0x01) << 1;
            switch (testvalue)
            {
            case 0:
                format.BackColor = Color.FromArgb(100, Color.Gainsboro);
                break;

            case 1:
                format.BackColor = Color.FromArgb(70, Color.Gainsboro);
                break;

            case 2:
                format.BackColor = Color.FromArgb(100, Color.Gold);
                break;

            case 3:
                format.BackColor = Color.FromArgb(50, Color.Gold);
                break;
            }
            return(format);
        }
Exemplo n.º 6
0
        public void RemoveRandom(int nodeCount)
        {
            Random random = new Random();

            while (nodeCount-- > 0)
            {
                // now find random node
                int index = (int)System.Math.Round(random.NextDouble() * (double)m_allNodes.Count - 1);
                if (index < 0)
                {
                    index = 0;
                }
                if (index >= m_allNodes.Count)
                {
                    index = m_allNodes.Count - 1;
                }
                if (index < 0)
                {
                    return;
                }
                CommonTools.Node node = m_allNodes[index];
                node.Owner.Remove(node);
                m_allNodes.Remove(node);
                if (node.HasChildren)
                {
                    foreach (CommonTools.Node childnode in node.Nodes)
                    {
                        m_allNodes.Remove(childnode);
                    }
                }
            }
        }
Exemplo n.º 7
0
        public void RenumberAllNodes()
        {
            int nameIndex            = m_collection.FieldIndex("name");
            int absoluteIndex        = m_collection.FieldIndex("absoluteIndex");
            int visibleIndex         = m_collection.FieldIndex("visibleIndex");
            int childCountIndex      = m_collection.FieldIndex("childCount");
            int totalChildCountIndex = m_collection.FieldIndex("totalChildCount");
            int visibleCountIndex    = m_collection.FieldIndex("visibleCount");

            int index = 0;

            // total index
            foreach (CommonTools.Node node in CommonTools.NodeCollection.ForwardNodeIterator(m_collection.FirstNode, false))
            {
                node[absoluteIndex] = index++;
            }
            // update total child count - slow slow
            foreach (CommonTools.Node node in CommonTools.NodeCollection.ForwardNodeIterator(m_collection.FirstNode, false))
            {
                CommonTools.Node leafnode = CommonTools.NodeCollection.FindNodesBottomLeaf(node, false);
                int index1 = (int)node[absoluteIndex];
                int index2 = (int)leafnode[absoluteIndex];
                node[totalChildCountIndex] = index2 - index1;
            }
            // visible index
            index = 0;
            foreach (CommonTools.Node node in CommonTools.NodeCollection.ForwardNodeIterator(m_collection.FirstNode, true))
            {
                node[visibleIndex] = index++;
            }
        }
Exemplo n.º 8
0
        public static int GetNodeIndex(CommonTools.NodeCollection coll, CommonTools.Node node)
        {
            int index = 0;

            CommonTools.Node tmp = coll.FirstNode;

            while (tmp != null && !CRMOntology.BusinessLayer.Node.Equals(tmp, node))
            {
                if (tmp.Nodes.Count > 0)
                {
                    int recursive = CRMOntology.BusinessLayer.Node.GetNodeIndex(tmp.Nodes, node);
                    if (recursive >= 0)
                    {
                        return(index);
                    }
                }
                tmp = tmp.NextSibling;
                index++;
            }
            if (tmp == null)
            {
                return(-1);
            }
            return(index);
        }
Exemplo n.º 9
0
        protected override Image GetNodeBitmap(CommonTools.Node node)
        {
            string path = GetPath(node);
            string key  = Path.GetExtension(path);

            if (key.Length == 0)
            {
                key = path;
            }
            Bitmap icon = null;

            if (key.Length > 0 && m_iconCache.TryGetValue(key, out icon))
            {
                return(icon);
            }
            try
            {
                icon             = CommonTools.IconUtil.GetIcon(path);
                m_iconCache[key] = icon;
                return(icon);
            }
            catch
            {
            }
            return(null);
        }
Exemplo n.º 10
0
        void DoScan()
        {
            while (true)
            {
                CommonTools.Node node = null;
                lock (m_foldersToScan)
                {
                    if (m_foldersToScan.Count == 0)
                    {
                        break;
                    }
                    node = m_foldersToScan[0];
                }

                // scan
                DoScan(node, 2000000000);

                lock (m_foldersToScan)
                {
                    this.BeginInvoke(new MethodInvoker(Invalidate));
                    if (m_foldersToScan.Count == 0)
                    {
                        break;
                    }
                    m_foldersToScan.RemoveAt(0);
                }
            }
        }
Exemplo n.º 11
0
        public CommonTools.Node FindNode(string text, bool searchFields)
        {
            CommonTools.Node ret = null;

            NodeFind(text, this.Nodes, searchFields, out ret);

            return(ret);
        }
Exemplo n.º 12
0
        public void FillRandom(int rootNodeCount, int nodeCount)
        {
            int nextId = m_allNodes.Count + m_leafNodes.Count;

            while (rootNodeCount-- > 0)
            {
                CommonTools.Node node = new CommonTools.Node(new object[2] {
                    nextId.ToString(), null
                });
                nextId++;
                m_collection.Add(node);
                m_allNodes.Add(node);
            }
            Random random = new Random();

            while (nodeCount-- > 0)
            {
                CommonTools.Node node = new CommonTools.Node(new object[2] {
                    nextId.ToString(), null
                });
                nextId++;

                // now find random node
                int index = (int)System.Math.Round(random.NextDouble() * (double)m_allNodes.Count - 1);
                if (index < 0)
                {
                    index = 0;
                }
                if (index >= m_allNodes.Count)
                {
                    index = m_allNodes.Count - 1;
                }

                m_allNodes[index].Nodes.Add(node);
                m_allNodes[index].Expand();

                int parentCount         = 0;
                CommonTools.Node parent = node.Parent;
                while (parent != null)
                {
                    parentCount++;
                    parent = parent.Parent;
                }

                if (parentCount < m_maxDepth)
                {
                    m_allNodes.Add(node);
                }
                else
                {
                    m_leafNodes.Add(node);
                }
            }
        }
Exemplo n.º 13
0
 public static bool Equals(CommonTools.Node SourceNode, object key)
 {
     for (int i = 0; i < SourceNode.GetDataLength; i++)
     {
         if (SourceNode[i].Equals(key))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 14
0
        public ResizeTree()
        {
            int cnt = 1;

            for (int x = 0; x < 100; x++)
            {
                CommonTools.Node node = new CommonTools.Node();
                node.Tag = new tmp(cnt++, cnt++, cnt++);
                Nodes.Add(node);
            }
        }
Exemplo n.º 15
0
        private int FindStopIndex(CommonTools.Node node)
        {
            int index = allNodes.IndexOf(node.NextSibling);

            if (index == -1)
            {
                if (allNodes.IndexOf(node.Parent) == -1)
                {
                    return(allNodes.Count);
                }
                return(FindStopIndex(node.Parent));
            }
            return(index);
        }
Exemplo n.º 16
0
        protected override object GetData(CommonTools.Node node, CommonTools.TreeListColumn column)
        {
            object data = base.GetData(node, column);

            if (data is string)
            {
                return(data);
            }
            if (data != null && column.Index == (int)eColumns.Size)
            {
                return(GetSizeString(node, m_sizeDisplayType));
            }
            return(data);
        }
Exemplo n.º 17
0
        public void GetGroups()
        {
            GlobalHelper.dbGroups.Read();

            foreach (Model_GroupDetails gd in GlobalHelper.dbGroups.ArrayListGroups)
            {
                // add groups to ListView
                ListViewGroup lvg = new ListViewGroup("gid" + gd.GroupID.ToString(), gd.GroupName);
                lvServerLists.Groups.Add(lvg);

                // add parent node to TreeListView
                CommonTools.Node n = new CommonTools.Node(gd.GroupName);
                n.MakeVisible();
                this.tlvServerLists.Nodes.Add("gid" + gd.GroupID.ToString(), n);
            }
        }
Exemplo n.º 18
0
        public void GetGroups()
        {
            GlobalHelper.dbGroups.Read();
            
            foreach (Database.GroupDetails gd in GlobalHelper.dbGroups.ArrayListGroups)
            {
                // add groups to ListView
                ListViewGroup lvg = new ListViewGroup("gid" + gd.GroupID.ToString(), gd.GroupName);
                lvServerLists.Groups.Add(lvg);

                // add parent node to TreeListView
                CommonTools.Node n = new CommonTools.Node(gd.GroupName);
                n.MakeVisible();
                this.tlvServerLists.Nodes.Add("gid" + gd.GroupID.ToString(), n);
            }
        }
Exemplo n.º 19
0
        protected override void OnAfterSelect(CommonTools.Node node)
        {
            if (node[(int)eColumns.Size] != null)
            {
                return;
            }

            string fullpath = GetPath(node);
            string root     = Path.GetPathRoot(fullpath);

            FileInfo info = new FileInfo(fullpath);

            if ((int)(info.Attributes & FileAttributes.Directory) > 0)
            {
                AddFolderToScan(node);
            }
        }
Exemplo n.º 20
0
 void AddNode(string path, CommonTools.Node parent, bool isDirectory)
 {
     CommonTools.Node node = new CommonTools.Node();
     node[(int)eColumns.Size]        = null;
     node[(int)eColumns.CreatedTime] = GetModifiedTime(path);
     node[(int)eColumns.Name]        = Path.GetFileName(path);
     SetSize(path, node);
     parent.Nodes.Add(node);
     if (isDirectory)
     {
         node.HasChildren = AnySubDirs(GetPath(node));
         if (node.HasChildren == false && IsIncluded(eIncludeTypes.File))
         {
             node.HasChildren = AnyFiles(GetPath(node));
         }
     }
 }
Exemplo n.º 21
0
        public void GetGroups()
        {
            var items = GlobalHelper.dbGroups.Items;

            foreach (Database.GroupDetails gd in items)
            {
                // add groups to ListView
                var           key = $"gid_{gd.Id}";
                ListViewGroup lvg = new ListViewGroup(key, gd.GroupName);
                lvServerLists.Groups.Add(lvg);

                // add parent node to TreeListView
                var n = new CommonTools.Node(gd.GroupName);
                n.MakeVisible();
                tlvServerLists.Nodes.Add(key, gd.GroupName);
            }
        }
Exemplo n.º 22
0
 void OnDeleteSelectedNode(object sender, EventArgs e)
 {
     BeginUpdate();
     CommonTools.Node node = FocusedNode;
     if (node != null && node.Owner != null)
     {
         node.Collapse();
         CommonTools.Node nextnode = CommonTools.NodeCollection.GetNextNode(node, 1);
         if (nextnode == null)
         {
             nextnode = CommonTools.NodeCollection.GetNextNode(node, -1);
         }
         node.Owner.Remove(node);
         FocusedNode = nextnode;
     }
     EndUpdate();
 }
Exemplo n.º 23
0
 public static bool Equals(CommonTools.Node SourceNode, CommonTools.Node TargetNode)
 {
     if (SourceNode.GetDataLength == TargetNode.GetDataLength)
     {
         for (int i = 0; i < SourceNode.GetDataLength; i++)
         {
             if (!SourceNode[i].Equals(TargetNode[i]))
             {
                 return(false);
             }
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 24
0
        void DoScan(CommonTools.Node node, long maxsize)
        {
            node[(int)eColumns.Size] = "Scanning...";
            this.BeginInvoke(new MethodInvoker(Invalidate));

            string fullpath    = GetPath(node);
            bool   exceededMax = false;
            long   size        = GetScanSize(new DirectoryInfo(fullpath), 0, maxsize, ref exceededMax);

            if (exceededMax)
            {
                node[(int)eColumns.Size] = new SizeInfo(size, SizeInfo.SizeType.Partial);
            }
            else
            {
                node[(int)eColumns.Size] = new SizeInfo(size, SizeInfo.SizeType.Complete);
            }
            this.BeginInvoke(new MethodInvoker(Invalidate));
        }
Exemplo n.º 25
0
        public bool ValidateNodeCount(CommonTools.Node node)
        {
            int totalcount = 1;

            if (node.HasChildren && node.Expanded)
            {
                totalcount += node.Nodes.slowTotalRowCount(true);
            }

            if (totalcount != node.VisibleNodeCount)
            {
                CommonTools.Tracing.WriteLine(0, "Node {0}, VisibleCount = cnt {1}, slow {2}, Validation = {3}",
                                              node[0].ToString(),
                                              node.VisibleNodeCount,
                                              totalcount,
                                              totalcount == node.VisibleNodeCount);
            }
            return(totalcount == node.VisibleNodeCount);
        }
Exemplo n.º 26
0
        void SetSize(string fullpath, CommonTools.Node node)
        {
            string root = Path.GetPathRoot(fullpath);

            if (root == fullpath)
            {
                DriveInfo info     = new DriveInfo(root);
                double    freesize = info.TotalFreeSpace;
                double    usedsize = info.TotalSize - info.TotalFreeSpace;
                node[(int)eColumns.Size] = GetSizeString((long)freesize, eSizeDisplayType.Best) + " free of " + GetSizeString((long)info.TotalSize, eSizeDisplayType.Best);
                return;
            }
            FileInfo fileinfo = new FileInfo(fullpath);

            if ((int)(fileinfo.Attributes & FileAttributes.Directory) == 0)
            {
                node[(int)eColumns.Size] = new SizeInfo(fileinfo.Length, SizeInfo.SizeType.Complete);
            }
        }
Exemplo n.º 27
0
        private void btnLoadRDF_Click(object sender, EventArgs e)
        {
            #region load OWL
            IGraph g = new Graph();

            try
            {
                FileLoader.Load(g, txtRDFPath.Text);

                if (g.Triples.Count > 0)
                {
                    foreach (Triple triple in g.Triples)
                    {
                        if (triple.Subject.NodeType == NodeType.Blank || triple.Object.NodeType == NodeType.Blank)
                        {
                            continue;
                        }

                        CommonTools.Node node = new CommonTools.Node(new object[] {
                            triple.Subject.ToString(),
                            triple.Predicate.ToString(),
                            triple.Object.ToString()
                        });
                        node.ImageId = 0;
                        treeListViewTriples.Nodes.Add(node);
                    }
                }
                else
                {
                    MessageBox.Show("could find any valid triple(s) in the given file", "Triples Error");
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "OWL Graph Error");
            }



            #endregion
        }
Exemplo n.º 28
0
        public Form2(CommonTools.Node node, ITRviewer itrView, bool maimuna)
        {
            InitializeComponent();
            bool itemsFound = false;

            distinctView.BeginUpdate();
            if (maimuna)
            {
                itemsFound = itrView.GetDistinctAt(node, distinctView.Items);
            }
            else
            {
                itemsFound = itrView.GetDistinct(node, distinctView.Items);
            }
            distinctView.EndUpdate();

            if (itemsFound)
            {
                this.Show();
            }
        }
Exemplo n.º 29
0
        string GetSizeString(CommonTools.Node node, eSizeDisplayType displayType)
        {
            object data = node[(int)eColumns.Size];

            if (data == null)
            {
                return(string.Empty);
            }
            if (data is string)
            {
                return(data.ToString());
            }

            SizeInfo info = data as SizeInfo;

            if (info.Type == SizeInfo.SizeType.Partial)
            {
                return("> 2GB");
            }
            return(GetSizeString(info.Size, displayType));
        }
Exemplo n.º 30
0
        void AddFolderToScan(CommonTools.Node node)
        {
            bool startscan = false;

            lock (m_foldersToScan)
            {
                if (m_foldersToScan.Contains(node))
                {
                    return;
                }
                node[(int)eColumns.Size] = "Scanning...";
                startscan = m_foldersToScan.Count == 0;
                m_foldersToScan.Add(node);
            }
            Invalidate();
            if (startscan)
            {
                System.Threading.Thread thread = new System.Threading.Thread(DoScan);
                thread.Start();
            }
        }
Exemplo n.º 31
0
        void lvServerLists_MouseDown(object sender, MouseEventArgs e)
        {
            ListViewHitTestInfo lvhi = lvServerLists.HitTest(new Point(e.X, e.Y));

            if (lvhi.Item != null)
            {
                Model_ServerDetails sd = (Model_ServerDetails)lvhi.Item.Tag;

                status_TextStatus.Text = sd.ServerName + " - " + sd.Server;

                CommonTools.Node n = tlvServerLists.FindNode(sd.ServerName, false);
                if (n != null)
                {
                    tlvServerLists.FocusedNode = n;
                }
            }
            else
            {
                status_TextStatus.Text = string.Empty;
            }
        }
Exemplo n.º 32
0
        public void GetServerLists()
        {
            tlvServerLists.Nodes.Clear();
            lvServerLists.Items.Clear();
            lvServerLists.Groups.Clear();

            GetGroups();

            GlobalHelper.dbServers.Read();

            foreach (Database.ServerDetails sd in GlobalHelper.dbServers.ArrayListServers)
            {
                // add items to ListView
                ListViewItem item = new ListViewItem(sd.ServerName);
                item.SubItems.Add(sd.Server);
                item.SubItems.Add(sd.Description);
                item.ImageIndex = 1;
                item.Tag = sd;
                item.Group = lvServerLists.Groups["gid" + sd.GroupID.ToString()];

                lvServerLists.Items.Add(item);

                // add items to TreeListView
                object[] o = {
                                 sd.ServerName,
                                 sd.Server,
                                 sd.Description
                             };
                CommonTools.Node n = new CommonTools.Node(o);
                n.Tag = sd;
                tlvServerLists.Nodes["gid" + sd.GroupID.ToString()].Nodes.Add(sd.UID, n);
                tlvServerLists.Nodes["gid" + sd.GroupID.ToString()].ExpandAll();
            }

            FixListViewColumn();
        }
Exemplo n.º 33
0
        private void LoadVariablesNode(Variable theVar, CommonTools.Node parent, object[] parentNodeData)
        {
            parentNodeData[2] = theVar.ToString();
            parent.SetData(parentNodeData);

            int i = 0;
            foreach (Variable aFieldVar in theVar.Fields)
            {
                CommonTools.Node newNode = new CommonTools.Node();

                object[] nodeData = new object[3];
                nodeData[0] = i++;
                nodeData[1] = aFieldVar.dbType.Signature;
                nodeData[2] = Utils.GetValueStr(aFieldVar.value, aFieldVar.dbType.Signature);
                newNode.SetData(nodeData);
                parent.Nodes.Add(newNode);

                LoadVariablesNode(aFieldVar, newNode, nodeData);
            }

            RefreshTreeViews();
        }
Exemplo n.º 34
0
        private void ReloadLocals()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new VoidDelegate(ReloadLocals));
                return;
            }

            LocalsTreeView.Nodes.Clear();

            List<Local> AllLocals = TheDebugger.Locals;
            for(int i = 0; i < AllLocals.Count; i++)
            {
                Local cLoc = AllLocals[i];
                CommonTools.Node localNode = new CommonTools.Node();

                object[] nodeData = new object[3];
                nodeData[0] = i;
                nodeData[1] = cLoc.dbType.Signature;
                nodeData[2] = Utils.GetValueStr(cLoc.value, cLoc.dbType.Signature == "System.String" ? null : cLoc.dbType.Signature);

                if(!cLoc.dbType.IsValueType)
                {
                    cLoc.LoadFields(TheDebugger, delegate()
                    {
                        this.Invoke(new VoidDelegate(delegate()
                        {
                            LoadVariablesNode(cLoc, localNode, nodeData);
                        }));
                    }, true);
                }

                localNode.SetData(nodeData);
                LocalsTreeView.Nodes.Add(localNode);
            }
            LocalsTreeView.Nodes.Add(new CommonTools.Node(""));
        }
Exemplo n.º 35
0
        private void ReloadArguments()
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new VoidDelegate(ReloadArguments));
                return;
            }

            ArgumentsTreeView.Nodes.Clear();

            List<Argument> AllArguments = TheDebugger.Arguments;
            for (int i = 0; i < AllArguments.Count; i++)
            {
                Argument cArg = AllArguments[i];
                CommonTools.Node argNode = new CommonTools.Node();
                
                object[] nodeData = new object[3];
                nodeData[0] = i;
                nodeData[1] = cArg.dbType.Signature;
                nodeData[2] = Utils.GetValueStr(cArg.value, cArg.dbType.Signature == "System.String" ? null : cArg.dbType.Signature);

                if (!cArg.dbType.IsValueType)
                {
                    cArg.LoadFields(TheDebugger, delegate()
                    {
                        this.Invoke(new VoidDelegate(delegate()
                        {
                            LoadVariablesNode(cArg, argNode, nodeData);
                        }));
                    }, true);
                }

                if(cArg.isReturnArg)
                {
                    nodeData[0] = "Ret";
                }

                argNode.SetData(nodeData);
                ArgumentsTreeView.Nodes.Add(argNode);
            }
            ArgumentsTreeView.Nodes.Add(new CommonTools.Node(""));
        }
        void tlvServerLists_MouseDown(object sender, MouseEventArgs e)
        {
            thisSelectedNode = tlvServerLists.CalcHitNode(new Point(e.X, e.Y));

            if (thisSelectedNode != null)
            {
                if (!thisSelectedNode.Key.Contains("gid")) // we don't need parent node / group
                {
                    Database.ServerDetails sd = (Database.ServerDetails)thisSelectedNode.Tag;
                    status_TextStatus.Text = sd.ServerName + " - " + sd.Server;
                    this.tlvch.EnableControls(true);

                    ListViewItem thisItem = this.lvServerLists.FindItemWithText(thisSelectedNode[0].ToString());

                    if (thisItem != null)
                    {
                        // select the item on our listview too
                        thisItem.Selected = true;
                    }
                }
                else
                {
                    // disable all unnecessary controls
                    this.tlvch.EnableControls(false);

                    // ok .. we like our ConnectAll button and Menu strip item to be enabled 
                    // so we can use it when we selected our parent node / group
                    // let's just enable them
                    toolbar_ConnectAll.Enabled = true;
                    lvServerListsContextMenu_ConnectAll.Enabled = true;

                    // and we have to let our "this._selIndex" at least know
                    // where to start so when we click ConnectAll in a parent node,
                    // it has a way to check.

                    // say the first item in a listview group.
                    // remeber, we are basing our events on listview instead of the treeview
                    // to prevent confusion
                    
                    //if (thisSelectedNode.HasChildren)
                    if (thisSelectedNode.Nodes.Count != 0)
                    {
                        // get the first child node
                        CommonTools.Node n = thisSelectedNode.Nodes.FirstNode;

                        // and match that in our listview
                        ListViewItem item = lvServerLists.FindItemWithText(n[0].ToString(), false, 0, true);
                        if (item != null)
                        {
                            // ok so we have it.
                            this._selIndex = item.Index;
                        }

                        item = null;
                        n = null;
                    }
                    else
                    {
                        // no child nodes
                        // let's just disable ConnectAll buttons and menu items again
                        // disable all unnecessary controls
                        this.tlvch.EnableControls(false);
                    }
                }
            }
            else
            {
                // disable all unnecessary controls
                // if nothing is selected
                this.tlvch.EnableControls(false);
            }
        }