Пример #1
0
        private ViewFolder <T> buildFolder(string path)
        {
            var views = ViewEngineSettings.FileSystem.FindFiles(path, _match).Select(x => new FubuFile(x, Provenance)
            {
                ProvenancePath = _content.Path
            })
                        .Select(_builder).Where(x => !_settings.IsExcluded(x));

            var folder = new ViewFolder <T>(path)
            {
                IsShared = _settings.IsSharedFolder(path)
            };

            folder.RelativePath = string.Empty;
            folder.Views.AddRange(views);

            _folders.Add(folder);


            ViewEngineSettings.FileSystem.ChildDirectoriesFor(path).Where(x => !_settings.FolderShouldBeIgnored(x)).Each(child =>
            {
                var childFolder          = buildFolder(child);
                childFolder.Parent       = folder;
                childFolder.RelativePath = (folder.RelativePath + "/" + childFolder.Name).TrimStart('/');

                if (childFolder.IsShared)
                {
                    folder.LayoutFolders.Add(childFolder);
                }
            });

            return(folder);
        }
Пример #2
0
        public ViewCollection(ViewFacility <T> facility, IFubuApplicationFiles files, Func <IFubuFile, T> builder, ViewEngineSettings settings, FileSet match)
        {
            if (match == null)
            {
                throw new ArgumentNullException("match");
            }
            _facility = facility;
            _files    = files;
            _builder  = builder;
            _settings = settings;
            _match    = match;

            _top = buildFolder(_files.RootPath);
        }
Пример #3
0
        public BottleViews(ViewFacility <T> facility, ContentFolder content, Func <IFubuFile, T> builder, ViewEngineSettings settings, FileSet match)
        {
            if (match == null)
            {
                throw new ArgumentNullException("match");
            }
            _facility = facility;
            _content  = content;
            _builder  = builder;
            _settings = settings;
            _match    = match;

            _top = buildFolder(content.Path);
        }