/// <summary> /// Creates a new file change tracking filter /// </summary> public FileChangeTrackingSelector( PathTable pathTable, LoggingContext loggingContext, IFileChangeTrackingSubscriptionSource tracker, IEnumerable <AbsolutePath> includedRoots, IEnumerable <AbsolutePath> excludedRoots) { Contract.Requires(pathTable != null); Contract.Requires(tracker != null); Contract.Requires(includedRoots != null); Contract.Requires(excludedRoots != null); m_semanticPathInfoMap = new FlaggedHierarchicalNameDictionary <bool>(pathTable, HierarchicalNameTable.NameFlags.Root); m_tracker = tracker; m_disabledTracker = FileChangeTracker.CreateDisabledTracker(loggingContext); foreach (var excludedRoot in excludedRoots) { if (m_semanticPathInfoMap.TryAdd(excludedRoot.Value, false)) { m_hasExcludedRoots = true; } } foreach (var includedRoot in includedRoots) { if (m_semanticPathInfoMap.TryAdd(includedRoot.Value, true)) { m_hasIncludedRoots = true; } } }
/// <summary> /// Sets the disabled tracker for unit tests. /// </summary> protected void SetDisabledTrackerTestOnly(IFileChangeTrackingSubscriptionSource disableTracker) { m_disabledTracker = disableTracker; }
/// <summary> /// Creates a file change tracking filter which allows all paths to be tracked /// </summary> public static FileChangeTrackingSelector CreateAllowAllFilter(PathTable pathTable, IFileChangeTrackingSubscriptionSource tracker) { return(new FileChangeTrackingSelector(pathTable, Events.StaticContext, tracker, Enumerable.Empty <AbsolutePath>(), Enumerable.Empty <AbsolutePath>())); }