Exemple #1
0
        void FillTree()
        {
            var separator = Path.PathSeparator;
            var search    = input.Text.Replace('\\', separator).Replace('/', separator);

            search = FormHelper.Transcriptor(search);
            if (openedFiles.Count > 0)
            {
                var matches = openedFiles;
                if (search.Length > 0)
                {
                    matches = SearchUtil.FindAll(openedFiles, search);
                }
                if (matches.Count > 0)
                {
                    tree.Items.AddRange(matches.ToArray());
                    if (settings.EnableItemSpacer)
                    {
                        tree.Items.Add(settings.ItemSpacer);
                    }
                }
            }
            if (recentFiles.Count > 0)
            {
                var matches = recentFiles;
                if (search.Length > 0)
                {
                    matches = SearchUtil.FindAll(matches, search);
                }
                if (matches.Count > 0)
                {
                    tree.Items.AddRange(matches.ToArray());
                }
            }
        }
Exemple #2
0
        void OnInputTextChanged(object sender, EventArgs e)
        {
            if (tree.Nodes.Count == 0)
            {
                return;
            }
            var search = input.Text;

            search = FormHelper.Transcriptor(search);
            var matches       = SearchUtil.FindAll(typeToNode.Keys.ToList(), search);
            var mathesIsEmpty = matches.Count == 0;

            foreach (var k in typeToNode)
            {
                ((ClassHierarchyNode)k.Value).Enabled = mathesIsEmpty || matches.Contains(k.Key);
            }
            tree.Refresh();
            if (mathesIsEmpty)
            {
                tree.SelectedNode = typeToNode[curClass.Type];
            }
            else
            {
                matches.Sort();
                tree.SelectedNode = typeToNode[matches[0]];
            }
        }
        static void FillNodes([NotNull] TreeNodeCollection nodes, [NotNull] string search, [NotNull] List <string> openedTypes, [NotNull] List <string> closedTypes, int maxItems, string separator)
        {
            if (openedTypes.Count > 0)
            {
                openedTypes = SearchUtil.FindAll(openedTypes, search);
            }
            TreeNode[] openedNodes;
            TreeNode[] closedNodes;
            if (maxItems > 0)
            {
                openedNodes = CreateClassNodes(search, openedTypes, maxItems);
                maxItems   -= openedTypes.Count;
                closedNodes = maxItems > 0 ? CreateClassNodes(search, SearchUtil.FindAll(closedTypes, search), maxItems) : new TreeNode[0];
            }
            else
            {
                openedNodes = CreateClassNodes(search, openedTypes);
                closedNodes = CreateClassNodes(search, SearchUtil.FindAll(closedTypes, search));
            }
            var hasOpenedMatches = openedNodes.Length > 0;
            var hasClosedMatches = closedNodes.Length > 0;

            if (hasOpenedMatches)
            {
                nodes.AddRange(openedNodes);
            }
            if (!string.IsNullOrEmpty(separator) && hasOpenedMatches && hasClosedMatches)
            {
                nodes.Add(separator);
            }
            if (hasClosedMatches)
            {
                nodes.AddRange(closedNodes);
            }
        }
        static void FillNodes([NotNull] TreeNodeCollection nodes, [NotNull] ClassModel inClass, [NotNull] string search)
        {
            var inFile = inClass.InFile;
            var isHaxe = inFile.haXe;
            var items  = SearchUtil.FindAll(inClass.Members.Items, search);

            foreach (var it in items)
            {
                nodes.Add(NodeFactory.CreateTreeNode(inFile, isHaxe, it));
            }
        }
Exemple #5
0
        void FillNodes(TreeNodeCollection nodes, FileModel inFile, MemberList members, bool isHaxe, bool currentClass, string search)
        {
            var items = FilterTypes(members.Items.ToList());

            items = SearchUtil.FindAll(items, search, isHaxe);
            foreach (var it in items)
            {
                nodes.Add(NodeFactory.CreateTreeNode(inFile, isHaxe, it));
            }
            if ((search.Length > 0 && SelectedNode == null || currentClass) && nodes.Count > 0)
            {
                tree.SelectedNode = nodes[0];
            }
        }
Exemple #6
0
        void FillTree()
        {
            var search = input.Text;

            search = FormHelper.Transcriptor(search);
            var projects = search.Length > 0 ? SearchUtil.FindAll(recentProjects, search) : recentProjects;

            if (projects.Count == 0)
            {
                return;
            }
            foreach (var it in projects)
            {
                tree.Nodes.Add(it, it, 0);
            }
        }