Beispiel #1
0
        private void EnableSearchMode()
        {
            if (!DrawInSearchMode)
            {
                _scrollbar.ToTop();
            }

            DrawInSearchMode = true;

            _searchModeTree.Clear();
            _searchModeTree.AddRange(EnumerateTree()
                                     .Where(node => node.Type != null)
                                     .Select(node =>
            {
                bool includeInSearch = FuzzySearch.CanBeIncluded(_searchString, node.FullTypeName, out int score);
                return(new { score, item = node, include = includeInSearch });
            })
                                     .Where(x => x.include)
                                     .OrderByDescending(x => x.score)
                                     .Select(x => x.item));
        }