Exemple #1
0
        public IImmutableList <string> GetTocFileKeySet(string key)
        {
            if (string.IsNullOrEmpty(key))
            {
                throw new ArgumentNullException(nameof(key));
            }
            if (TocMap.TryGetValue(key, out HashSet <string> sets))
            {
                return(sets.ToImmutableArray());
            }

            return(null);
        }
Exemple #2
0
        public void RegisterToc(string tocFileKey, string fileKey)
        {
            if (string.IsNullOrEmpty(fileKey))
            {
                throw new ArgumentNullException(nameof(fileKey));
            }
            if (string.IsNullOrEmpty(tocFileKey))
            {
                throw new ArgumentNullException(nameof(tocFileKey));
            }
            HashSet <string> sets;

            if (TocMap.TryGetValue(fileKey, out sets))
            {
                sets.Add(tocFileKey);
            }
            else
            {
                TocMap[fileKey] = new HashSet <string>(FilePathComparer.OSPlatformSensitiveComparer)
                {
                    tocFileKey
                };
            }
        }