Пример #1
0
        public WebRegistry()
        {
            ForRequestedType <IViewFolder>().AsSingletons().TheDefault.Is.ConstructedBy(
                ctx =>
            {
                var folder = new VirtualPathProviderViewFolder(ctx.GetInstance <FubuConventions>().ViewFileBasePath);
                folder.AddSharedPath(ctx.GetInstance <SparkConventions>().LayoutViewFileBasePath);
                return(folder);
            });

            ForRequestedType <ISparkSettings>().TheDefault.IsThis(new SparkSettings().AddNamespace("FubuTask.Presentation.Controllers"));

            ForRequestedType <ISparkViewEngine>().TheDefault.Is.OfConcreteType <SparkViewEngine>()
            .SetterDependency(e => e.Settings).IsTheDefault()
            .SetterDependency(e => e.ViewFolder).IsTheDefault();

            ForRequestedType <IResponseStatusService>().TheDefault.Is.OfConcreteType <ResponseStatusService>();

            ForRequestedType <IViewRenderer>().TheDefault.Is.OfConcreteType <SparkViewRenderer>();

            ForRequestedType <SparkConventions>().AsSingletons().TheDefault.Is.ConstructedBy(
                ctx => new SparkConventions(ctx.GetInstance <FubuConventions>()));

            ForRequestedType <IPrincipalFactory>()
            .TheDefault.Is.OfConcreteType <LoggedOnPrincipleFactory>();

            //ForRequestedType<ISecurityDataService>().TheDefault.Is.OfConcreteType<SecurityDataService>();
        }
Пример #2
0
        public void AddTheme(string name)
        {
            IViewFolder themeFolder = new VirtualPathProviderViewFolder("~/Themes/" + name);

            themeFolder = themeFolder.Append(_defaultViewFolder);

            var container = SparkEngineStarter.CreateContainer();

            container.SetService(themeFolder);
            _themedEngines.Add(name, container.GetService <IViewEngine>());
        }