Ejemplo n.º 1
0
        public StorageHierarchies(IFileSystemApi fileSystemApi, NamedRoot[] namedRoots, Graft[] grafts, IDictionary <LocalRoot, RelativePathFilter> filtersByRoot)
        {
            this.fileSystemApi = fileSystemApi;
            this.namedRoots    = namedRoots;
            this.filtersByRoot = filtersByRoot;

            graftsByChild  = grafts.ToDictionary(g => g.ChildRoot);
            graftsByParent = grafts.GroupBy(g => g.GraftPoint.Root).ToDictionary(g => g.Key, g => g.ToArray());
            var allRoots = namedRoots.Select(r => r.LocalRoot).Concat(graftsByChild.Keys);

            rootsLongestToShortest = allRoots.Distinct().OrderByDescending(r => r.RootUri.LocalPath.Length).ToList();

            AllRoots   = new ReadOnlyCollection <LocalRoot>(rootsLongestToShortest);
            NamedRoots = new ReadOnlyCollection <NamedRoot>(namedRoots);
            Grafts     = new ReadOnlyCollection <Graft>(grafts);
        }
 public StorageHierarchiesBuilder(IFileSystemApi fileSystemApi)
 {
     this.fileSystemApi = fileSystemApi;
 }