protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems)
            {
                IVsHierarchy solutionHierarchy = (IVsHierarchy)_serviceProvider.GetService(typeof(IVsSolution));

                IReadOnlyObservableSet <IVsHierarchyItem> sourceItems = await _hierarchyCollectionProvider.GetDescendantsAsync(solutionHierarchy, CancellationToken);

                return(await _hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(sourceItems, ShouldIncludeInFilter, CancellationToken));
            }
            protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems)
            {
                IVsHierarchyItem root = HierarchyUtilities.FindCommonAncestor(rootItems);
                IReadOnlyObservableSet <IVsHierarchyItem> sourceItems;

                sourceItems = await _hierarchyCollectionProvider.GetDescendantsAsync(root.HierarchyIdentity.NestedHierarchy, CancellationToken);

                return(await _hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(sourceItems, MeetsFilter, CancellationToken));
            }
Esempio n. 3
0
            // Gets the items to be included from this filter provider.
            // rootItems is a collection that contains the root of your solution
            // Returns a collection of items to be included as part of the filter
            protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems)
            {
                IVsHierarchyItem root = HierarchyUtilities.FindCommonAncestor(rootItems);
                IReadOnlyObservableSet <IVsHierarchyItem> sourceItems;

                sourceItems = await _hierarchyCollectionProvider.GetDescendantsAsync(
                    root.HierarchyIdentity.NestedHierarchy,
                    CancellationToken);

                IFilteredHierarchyItemSet includedItems = await _hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(
                    sourceItems,
                    _shouldInclude == null?(Predicate <IVsHierarchyItem>) ShouldIncludeInFilterByRegex : (Predicate <IVsHierarchyItem>)ShouldIncludeInFilterByFunc,
                    CancellationToken);

                return(includedItems);
            }
Esempio n. 4
0
            // Gets the items to be included from this filter provider.
            // rootItems is a collection that contains the root of your solution
            // Returns a collection of items to be included as part of the filter
            protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems)
            {
                // get default hierarchy
                var root        = HierarchyUtilities.FindCommonAncestor(rootItems);
                var sourceItems = await _hierarchyCollectionProvider.GetDescendantsAsync(
                    root.HierarchyIdentity.NestedHierarchy,
                    CancellationToken);

                // switch thread context
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(CancellationToken);

                // get diff stats
                var stats = GetRepoStats();

                if (stats == null)
                {
                    return(sourceItems);
                }
                return(await _hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(
                           sourceItems,
                           ShouldIncludeInFilter(stats),
                           CancellationToken));
            }
Esempio n. 5
0
            // Gets the items to be included from this filter provider.
            // rootItems is a collection that contains the root of your solution
            // Returns a collection of items to be included as part of the filter
            protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems)
            {
                IVsHierarchyItem root = HierarchyUtilities.FindCommonAncestor(rootItems);
                IReadOnlyObservableSet <IVsHierarchyItem> sourceItems;

                sourceItems = await hierarchyCollectionProvider.GetDescendantsAsync(
                    root.HierarchyIdentity.NestedHierarchy,
                    CancellationToken);

                IFilteredHierarchyItemSet includedItems = await hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(
                    sourceItems,
                    FilesWithBookmarksFilteredHierarchyItemSet.IsFileWithBookmarks,
                    CancellationToken);

                var wrapper = new FilesWithBookmarksFilteredHierarchyItemSet(sourceItems, includedItems);

                if (FilesWithBookmarksFilteredHierarchyItemSet.Instance != null)
                {
                    FilesWithBookmarksFilteredHierarchyItemSet.Instance.Dispose();
                }
                FilesWithBookmarksFilteredHierarchyItemSet.Instance = wrapper;

                return(wrapper);
            }