public void Setup()
        {
            var types = new TypePool();
            types.AddAssembly(GetType().Assembly);

            _runner = new ViewEngineSettings();
        }
Example #2
0
        public void Setup()
        {
            var types = new TypePool();

            types.AddAssembly(GetType().Assembly);

            _runner = new ViewEngineSettings();
        }
Example #3
0
        public virtual void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
        {
            var builder = CreateBuilder(graph.Settings, files);
            var match   = FindMatching(graph.Settings);

            // HAS TO BE SHALLOW
            match.DeepSearch = false;

            _bottle = new ViewCollection <T>(this, files, builder, settings, match);

            _views = _bottle.AllViews().ToList();
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
0
        public override void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
        {
            configureNamespaces(graph);

            base.Fill(settings, graph, timer, files);

            var bindingTemplates = files
                                   .FindFiles(FileSet.Shallow("Shared/bindings.xml"))
                                   .Select(x => new SparkTemplate(files, x, _engine, graph.Settings.Get <SparkEngineSettings>())).ToArray();

            _engine.ViewFolder          = new TemplateViewFolder(AllTemplates());
            _engine.DefaultPageBaseType = typeof(FubuSparkView).FullName;
            _engine.BindingProvider     = new FubuBindingProvider(bindingTemplates);
            _engine.PartialProvider     = new FubuPartialProvider(this);
        }
        public void should_ignore_folders()
        {
            var settings = new ViewEngineSettings();
            settings.FolderShouldBeIgnored("/foo/fubu-content/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/fubu-content").ShouldBeTrue();
            settings.FolderShouldBeIgnored("fubu-content").ShouldBeTrue();
            settings.FolderShouldBeIgnored("bin").ShouldBeTrue();
            settings.FolderShouldBeIgnored("obj").ShouldBeTrue();
            settings.FolderShouldBeIgnored("node_modules").ShouldBeTrue();
            settings.FolderShouldBeIgnored("node_modules/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/node_modules/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/bar/node_modules/").ShouldBeTrue();

            settings.FolderShouldBeIgnored("ok").ShouldBeFalse();
            settings.FolderShouldBeIgnored("ok/").ShouldBeFalse();
            settings.FolderShouldBeIgnored("/ok").ShouldBeFalse();
            settings.FolderShouldBeIgnored("/ok/good/alright").ShouldBeFalse();
        }
Example #8
0
        public void should_ignore_folders()
        {
            var settings = new ViewEngineSettings();

            settings.FolderShouldBeIgnored("/foo/fubu-content/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/fubu-content").ShouldBeTrue();
            settings.FolderShouldBeIgnored("fubu-content").ShouldBeTrue();
            settings.FolderShouldBeIgnored("bin").ShouldBeTrue();
            settings.FolderShouldBeIgnored("obj").ShouldBeTrue();
            settings.FolderShouldBeIgnored("node_modules").ShouldBeTrue();
            settings.FolderShouldBeIgnored("node_modules/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/node_modules/").ShouldBeTrue();
            settings.FolderShouldBeIgnored("/foo/bar/node_modules/").ShouldBeTrue();

            settings.FolderShouldBeIgnored("ok").ShouldBeFalse();
            settings.FolderShouldBeIgnored("ok/").ShouldBeFalse();
            settings.FolderShouldBeIgnored("/ok").ShouldBeFalse();
            settings.FolderShouldBeIgnored("/ok/good/alright").ShouldBeFalse();
        }
Example #9
0
        public virtual void Fill(ViewEngineSettings settings, BehaviorGraph graph)
        {
            var builder = CreateBuilder(graph.Settings);
            var match   = FindMatching(graph.Settings);

            // HAS TO BE SHALLOW
            match.DeepSearch = false;

            graph.Files.AllFolders.Each(folder => {
                var bottle = new BottleViews <T>(this, folder, builder, settings, match);
                _bottles.Add(bottle);
            });

            LayoutAttachment = PackageRegistry.Timer.RecordTask("Attaching Layouts for " + GetType().Name,
                                                                () => {
                AttachLayouts(settings);
            });

            _views = _bottles.SelectMany(x => x.AllViews()).ToList();
        }
Example #10
0
 public PageActivationExpression(ViewEngineSettings parent, Func <IViewToken, bool> filter)
 {
     _parent = parent;
     _filter = filter;
 }
Example #11
0
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph)
 {
     _views = tokens().Where(x => !graph.Settings.Get <ViewEngineSettings>().IsExcluded(x)).ToList();
 }
Example #12
0
 public PartialRenderer(ViewEngineSettings views)
 {
     _views = views;
 }
 public void AttachLayouts(ViewEngineSettings settings)
 {
 }
Example #14
0
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph)
 {
     _views = tokens().Where(x => !graph.Settings.Get<ViewEngineSettings>().IsExcluded(x)).ToList();
 }
Example #15
0
 public void AttachLayouts(ViewEngineSettings settings)
 {
     _bottles.Each(x => x.AttachLayouts(settings.ApplicationLayoutName));
 }
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
 {
     _views = tokens().Where(x => !graph.Settings.Get<ViewEngineSettings>().IsExcluded(x)).ToList();
 }
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph)
 {
     throw new NotImplementedException();
 }
 public void AttachLayouts(ViewEngineSettings settings)
 {
 }
 public void Setup()
 {
     _runner = new ViewEngineSettings();
 }
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
 {
     throw new NotImplementedException();
 }
Example #21
0
 public PartialRenderer(ViewEngineSettings views)
 {
     _views = views;
 }
 public void Setup()
 {
     _runner = new ViewEngineSettings();
 }
Example #23
0
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
 {
     _views = tokens().Where(x => !graph.Settings.Get <ViewEngineSettings>().IsExcluded(x)).ToList();
 }
Example #24
0
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph)
 {
     throw new NotImplementedException();
 }
 public void Fill(ViewEngineSettings settings, BehaviorGraph graph, IPerfTimer timer, IFubuApplicationFiles files)
 {
     throw new NotImplementedException();
 }