Exemple #1
0
        public ExtendedTester()
        {
            var testRoot = Path.Combine(Directory.GetCurrentDirectory(), "Templates");

            var pathApp = Path.Combine(testRoot, "App");
            var pathPackage1 = Path.Combine(pathApp, "fubu-packages", "Package1", "WebContent");
            var pathPackage2 = Path.Combine(testRoot, "Package2");

            var packages = new List<IPackageInfo>();
            var pack1 = new PackageInfo(Package1);
            var pack2 = new PackageInfo(Package2);
            pack1.RegisterFolder(BottleFiles.WebContentFolder, pathPackage1);
            pack2.RegisterFolder(BottleFiles.WebContentFolder, pathPackage2);
            packages.Add(pack1);
            packages.Add(pack2);

            var scanner = new TemplateFinder(new FileScanner(), packages) {HostPath = pathApp};

            var allTemplates = new TemplateRegistry();
            allTemplates.AddRange(scanner.FindInPackages());
            allTemplates.AddRange(scanner.FindInHost());

            var viewPathPolicy = new ViewPathPolicy();
            allTemplates.Each(viewPathPolicy.Apply);
            _viewFolder = new TemplateViewFolder(allTemplates);
            _engine = new SparkViewEngine
            {
                ViewFolder = _viewFolder,
                BindingProvider = new FubuBindingProvider(new TemplateRegistry(allTemplates))
            };

            _pak1TemplateRegistry = new TemplateRegistry(allTemplates.ByOrigin(Package1));
            _pak2TemplateRegistry = new TemplateRegistry(allTemplates.ByOrigin(Package2));
            _appTemplateRegistry = new TemplateRegistry(allTemplates.FromHost());
        }
Exemple #2
0
        public SparkExtension()
        {
            _templateRegistry = new TemplateRegistry();
            _finder = new TemplateFinder();
            _composer = new TemplateComposer(_templateRegistry);

            defaults();
        }
        public void Configure(TemplateFinder finder)
        {
            finder.IncludeFile("*spark");
            // TODO: This is not automatically synched with what the attacher looks for.
            finder.IncludeFile("bindings.xml");

            finder.ExcludeHostDirectory(FubuMvcPackageFacility.FubuPackagesFolder);
            finder.ExcludeHostDirectory(FubuMvcPackageFacility.FubuPackagesFolder, FubuMvcPackageFacility.FubuContentFolder);
            finder.ExcludeHostDirectory(FubuMvcPackageFacility.FubuContentFolder);
        }
 public void Configure(TemplateFinder finder)
 {
     _configure(finder);
 }