/// <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;
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Class constructor
        /// </summary>
        public MountPathExpander(PathTable pathTable)
        {
            Contract.Requires(pathTable != null);

            m_nameExpander        = new Expander();
            m_parent              = null;
            PathTable             = pathTable;
            m_expandedRootsByName = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
            m_mountsByName        = new Dictionary <string, SemanticPathInfo>(StringComparer.OrdinalIgnoreCase);
            m_semanticPathInfoMap = new FlaggedHierarchicalNameDictionary <SemanticPathInfo>(pathTable, HierarchicalNameTable.NameFlags.Root);
            m_moduleExpanders     = new Dictionary <ModuleId, MountPathExpander>();
            m_alternativeRoots    = new List <SemanticPathInfo>();
        }