public void RemoveFromView(string fileName)
        {
            // the item is present?
            string check = (string)checkEntries[fileName];

            if (check == null)
            {
                return;
            }

            // remove item
            try
            {
                classTree.BeginUpdate();
                DebugConsole.Trace("REMOVE " + fileName);
                foreach (TreeNode node in classTree.Nodes)
                {
                    if ((string)node.Tag == fileName)
                    {
                        classTree.Nodes.Remove(node);
                    }
                }
                //
                checkEntries.Remove(fileName);
            }
            finally
            {
                classTree.EndUpdate();
            }
        }
        private void HighlightAllMachingDeclaration(string text)
        {
            try
            {
                classTree.BeginUpdate();
                classTree.CollapseAll();
                TreeNodeCollection nodes = classTree.Nodes;
                TreeNode           node;
                TreeNode           expandedNode = null;
                // checking wich node is expanded
                foreach (TreeNode sub in nodes)
                {
                    if (sub.IsExpanded)
                    {
                        expandedNode = sub;
                    }
                }
                foreach (TreeNode sub in nodes)
                {
                    node = sub;

                    // hilights the name of the class (if mach)
                    ShowAndHilightNode(node, IsMach(node.Text, text));
                    // where to start the hilighting
                    int startWith = 0;
                    if (showExtend)
                    {
                        startWith++;                                 // has Extend node
                    }
                    if (showImports)
                    {
                        startWith++;                                  // has Imports node
                    }
                    for (int index = startWith; index < node.Nodes.Count; index++)
                    {
                        TreeNodeCollection groupNodes = node.Nodes[index].Nodes;
                        HilightDeclarationInGroup(groupNodes, text);
                    }
                }
                Win32.Scrolling.scrollToLeft(classTree);
                if (expandedNode != null)
                {
                    expandedNode.Expand();
                }
            }
            catch (Exception ex)
            {
                // log error and disable search field
                ErrorHandler.AddToLog(ex);
                findProcTxt.Visible = false;
            }
            finally
            {
                classTree.EndUpdate();
            }
        }
Beispiel #3
0
        private void highlightTimer_Tick(object sender, EventArgs e)
        {
            highlightTimer.Stop();

            outlineTree.BeginUpdate();
            if (currentHighlight != null)
            {
                //currentHighlight.BackColor = System.Drawing.SystemColors.Window;
                currentHighlight.ForeColor = System.Drawing.SystemColors.WindowText;
            }
            outlineTree.SelectedNode = currentHighlight = nextHighlight;
            if (currentHighlight != null)
            {
                if (outlineTree.State != null && currentHighlight.TreeView != null)
                {
                    outlineTree.State.highlight = currentHighlight.FullPath;
                }

                //currentHighlight.BackColor = System.Drawing.Color.LightGray;
                currentHighlight.ForeColor = System.Drawing.Color.Blue;
            }
            outlineTree.EndUpdate();
        }