コード例 #1
0
        private void configureServices(IServiceRegistry services)
        {
            var configuration = new TemplateServiceConfiguration {
                BaseTemplateType = typeof(FubuRazorView)
            };

            services.ReplaceService <ITemplateRegistry <IRazorTemplate> >(_templateRegistry);
            services.ReplaceService <IFubuTemplateService>(new FubuTemplateService(_templateRegistry, new TemplateService(configuration), new FileSystem()));
            services.ReplaceService <ITemplateServiceConfiguration>(configuration);
            services.ReplaceService <IParsingRegistrations <IRazorTemplate> >(_parsings);
            services.SetServiceIfNone <ITemplateDirectoryProvider <IRazorTemplate>, TemplateDirectoryProvider <IRazorTemplate> >();
            services.SetServiceIfNone <ISharedPathBuilder>(new SharedPathBuilder());

            var graph = new SharingGraph();

            services.SetServiceIfNone(graph);
            services.SetServiceIfNone <ISharingGraph>(graph);


            services.FillType <IActivator, RazorActivator>();

            services.FillType <ISharedTemplateLocator <IRazorTemplate>, SharedTemplateLocator <IRazorTemplate> >();
            services.FillType <ISharingAttacher <IRazorTemplate>, MasterAttacher <IRazorTemplate> >();
            services.FillType <ITemplateSelector <IRazorTemplate>, RazorTemplateSelector>();
            services.FillType <IActivator, SharingAttacherActivator <IRazorTemplate> >();
            services.FillType <IRenderStrategy, AjaxRenderStrategy>();
            services.FillType <IRenderStrategy, DefaultRenderStrategy>();

            services.SetServiceIfNone <IViewModifierService <IFubuRazorView>, ViewModifierService <IFubuRazorView> >();

            services.FillType <IViewModifier <IFubuRazorView>, LayoutActivation>();
            services.FillType <IViewModifier <IFubuRazorView>, PartialRendering>();
            services.FillType <IViewModifier <IFubuRazorView>, FubuPartialRendering>();
        }
コード例 #2
0
        private void configureServices(IServiceRegistry services)
        {
            var configuration = new TemplateServiceConfiguration {BaseTemplateType = typeof (FubuRazorView)};

            services.ReplaceService<ITemplateRegistry<IRazorTemplate>>(_templateRegistry);
            services.ReplaceService<IFubuTemplateService>(new FubuTemplateService(_templateRegistry, new TemplateService(configuration), new FileSystem()));
            services.ReplaceService<ITemplateServiceConfiguration>(configuration);
            services.ReplaceService<IParsingRegistrations<IRazorTemplate>>(_parsings);
            services.SetServiceIfNone<ITemplateDirectoryProvider<IRazorTemplate>, TemplateDirectoryProvider<IRazorTemplate>>();
            services.SetServiceIfNone<ISharedPathBuilder>(new SharedPathBuilder());

            var graph = new SharingGraph();
            services.SetServiceIfNone(graph);
            services.SetServiceIfNone<ISharingGraph>(graph);


            services.FillType<IActivator, RazorActivator>();

            services.FillType<ISharedTemplateLocator<IRazorTemplate>, SharedTemplateLocator<IRazorTemplate>>();
            services.FillType<ISharingAttacher<IRazorTemplate>, MasterAttacher<IRazorTemplate>>();
            services.FillType<ITemplateSelector<IRazorTemplate>, RazorTemplateSelector>();
            services.FillType<IActivator, SharingAttacherActivator<IRazorTemplate>>();
            services.FillType<IRenderStrategy, AjaxRenderStrategy>();
            services.FillType<IRenderStrategy, DefaultRenderStrategy>();

            services.SetServiceIfNone<IViewModifierService<IFubuRazorView>, ViewModifierService<IFubuRazorView>>();

            services.FillType<IViewModifier<IFubuRazorView>, LayoutActivation>();
            services.FillType<IViewModifier<IFubuRazorView>, PartialRendering>();
            services.FillType<IViewModifier<IFubuRazorView>, FubuPartialRendering>();
        }
コード例 #3
0
 private static void addActivators(IServiceRegistry registry)
 {
     registry.FillType(typeof (IActivator), typeof (AssetGraphConfigurationActivator));
     registry.FillType(typeof (IActivator), typeof (AssetPipelineBuilderActivator));
     registry.FillType(typeof (IActivator), typeof (AssetDeclarationVerificationActivator));
     registry.FillType(typeof (IActivator), typeof (MimetypeRegistrationActivator));
     registry.FillType(typeof (IActivator), typeof (AssetCombinationBuildingActivator));
     registry.FillType(typeof (IActivator), typeof (AssetPolicyActivator));
     registry.FillType(typeof (IActivator), typeof (AssetFileWatchingActivator));
 }
コード例 #4
0
 private static void addActivators(IServiceRegistry registry)
 {
     registry.FillType(typeof(IActivator), typeof(AssetGraphConfigurationActivator));
     registry.FillType(typeof(IActivator), typeof(AssetPipelineBuilderActivator));
     registry.FillType(typeof(IActivator), typeof(AssetDeclarationVerificationActivator));
     registry.FillType(typeof(IActivator), typeof(MimetypeRegistrationActivator));
     registry.FillType(typeof(IActivator), typeof(AssetCombinationBuildingActivator));
     registry.FillType(typeof(IActivator), typeof(AssetPolicyActivator));
     registry.FillType(typeof(IActivator), typeof(AssetFileWatchingActivator));
 }
コード例 #5
0
ファイル: SparkEngine.cs プロジェクト: chadmyers/fubumvc
        private void configureServices(IServiceRegistry services)
        {
            services.ReplaceService <ISparkTemplateRegistry>(_templateRegistry);
            services.ReplaceService <ITemplateRegistry <ITemplate> >(_templateRegistry);
            services.ReplaceService <IParsingRegistrations <ITemplate> >(_parsings);

            var graph = new SharingGraph();

            services.SetServiceIfNone(graph);
            services.SetServiceIfNone <ISharingGraph>(graph);

            services.SetServiceIfNone <ISparkViewEngine>(new SparkViewEngine());
            services.SetServiceIfNone <ICacheService>(new DefaultCacheService(HttpRuntime.Cache));

            services.SetServiceIfNone(new SharingLogsCache());

            services.FillType <IActivator, SharingConfigActivator>();
            services.FillType <IActivator, SharingPolicyActivator>();
            services.FillType <IActivator, SharingAttacherActivator <ITemplate> >();
            services.FillType <IActivator, SparkActivator>();
            services.FillType <IActivator, SparkPrecompiler>();

            services.FillType <ISharingAttacher <ITemplate>, MasterAttacher <ITemplate> >();
            services.FillType <ISharingAttacher <ITemplate>, BindingsAttacher>();

            services.SetServiceIfNone <ISharedPathBuilder>(new SharedPathBuilder());
            services.SetServiceIfNone <ITemplateDirectoryProvider <ITemplate>, TemplateDirectoryProvider <ITemplate> >();
            services.SetServiceIfNone <ISharedTemplateLocator, SharedTemplateLocator>();
            services.FillType <ISharedTemplateLocator <ITemplate>, SharedTemplateLocator>();

            services.FillType <IRenderStrategy, NestedRenderStrategy>();
            services.FillType <IRenderStrategy, AjaxRenderStrategy>();
            services.FillType <IRenderStrategy, DefaultRenderStrategy>();

            services.FillType <ITemplateSelector <ITemplate>, SparkTemplateSelector>();

            services.SetServiceIfNone <IViewEntryProviderCache, ViewEntryProviderCache>();
            services.SetServiceIfNone <IViewModifierService <IFubuSparkView>, ViewModifierService <IFubuSparkView> >();

            services.FillType <IViewModifier <IFubuSparkView>, PageActivation <IFubuSparkView> >();
            services.FillType <IViewModifier <IFubuSparkView>, SiteResourceAttacher>();
            services.FillType <IViewModifier <IFubuSparkView>, ContentActivation>();
            services.FillType <IViewModifier <IFubuSparkView>, OnceTableActivation>();
            services.FillType <IViewModifier <IFubuSparkView>, OuterViewOutputActivator>();
            services.FillType <IViewModifier <IFubuSparkView>, NestedViewOutputActivator>();
            services.FillType <IViewModifier <IFubuSparkView>, ViewContentDisposer>();
            services.FillType <IViewModifier <IFubuSparkView>, NestedOutputActivation>();

            services.SetServiceIfNone <IHtmlEncoder, DefaultHtmlEncoder>();

            services.SetServiceIfNone(new DefaultViewDefinitionPolicy());
            services.SetServiceIfNone <IViewDefinitionResolver, ViewDefinitionResolver>();
        }
 public void Register(IEnumerable <Type> matchedTypes, IServiceRegistry services)
 {
     matchedTypes
     .Where(t => _pluginType.IsAssignableFrom(t) && t.IsClass && !t.IsAbstract)
     .Each(t => services.FillType(_pluginType, t));
 }
コード例 #7
0
 public void Register(IEnumerable <Type> matchedTypes, IServiceRegistry services)
 {
     matchedTypes
     .Where(t => t.Closes(_openType) && t.IsClass && !t.IsAbstract)
     .Each(t => services.FillType(_openType, t));
 }
コード例 #8
0
ファイル: SparkEngine.cs プロジェクト: ahjohannessen/fubumvc
        private void configureServices(IServiceRegistry services)
        {
            services.ReplaceService<ISparkTemplateRegistry>(_templateRegistry);
            services.ReplaceService<ITemplateRegistry<ITemplate>>(_templateRegistry);
            services.ReplaceService<IParsingRegistrations<ITemplate>>(_parsings);

            var graph = new SharingGraph();
            services.SetServiceIfNone(graph);
            services.SetServiceIfNone<ISharingGraph>(graph);

            services.SetServiceIfNone<ISparkViewEngine>(new SparkViewEngine());
            services.SetServiceIfNone<ICacheService>(new DefaultCacheService(HttpRuntime.Cache));

            services.SetServiceIfNone(new SharingLogsCache());

            services.FillType<IActivator, SharingConfigActivator>();
            services.FillType<IActivator, SharingPolicyActivator>();
            services.FillType<IActivator, SharingAttacherActivator<ITemplate>>();
            services.FillType<IActivator, SparkActivator>();
            services.FillType<IActivator, SparkPrecompiler>();

            services.FillType<ISharingAttacher<ITemplate>, MasterAttacher<ITemplate>>();
            services.FillType<ISharingAttacher<ITemplate>, BindingsAttacher>();

            services.SetServiceIfNone<ISharedPathBuilder>(new SharedPathBuilder());
            services.SetServiceIfNone<ITemplateDirectoryProvider<ITemplate>, TemplateDirectoryProvider<ITemplate>>();
            services.SetServiceIfNone<ISharedTemplateLocator, SharedTemplateLocator>();
            services.FillType<ISharedTemplateLocator<ITemplate>, SharedTemplateLocator>();

            services.FillType<IRenderStrategy, NestedRenderStrategy>();
            services.FillType<IRenderStrategy, AjaxRenderStrategy>();
            services.FillType<IRenderStrategy, DefaultRenderStrategy>();

            services.FillType<ITemplateSelector<ITemplate>, SparkTemplateSelector>();

            services.SetServiceIfNone<IViewEntryProviderCache, ViewEntryProviderCache>();
            services.SetServiceIfNone<IViewModifierService<IFubuSparkView>, ViewModifierService<IFubuSparkView>>();

            services.FillType<IViewModifier<IFubuSparkView>, PageActivation<IFubuSparkView>>();
            services.FillType<IViewModifier<IFubuSparkView>, SiteResourceAttacher>();
            services.FillType<IViewModifier<IFubuSparkView>, ContentActivation>();
            services.FillType<IViewModifier<IFubuSparkView>, OnceTableActivation>();
            services.FillType<IViewModifier<IFubuSparkView>, OuterViewOutputActivator>();
            services.FillType<IViewModifier<IFubuSparkView>, NestedViewOutputActivator>();
            services.FillType<IViewModifier<IFubuSparkView>, ViewContentDisposer>();
            services.FillType<IViewModifier<IFubuSparkView>, NestedOutputActivation>();

            services.SetServiceIfNone<IHtmlEncoder, DefaultHtmlEncoder>();

            services.SetServiceIfNone(new DefaultViewDefinitionPolicy());
            services.SetServiceIfNone<IViewDefinitionResolver, ViewDefinitionResolver>();
        }
コード例 #9
0
        // TODO: Tests that ensure all of these defaults are set.

        private static void configureServices(IServiceRegistry services)
        {
            services.SetServiceIfNone <ITemplateRegistry>(_templateRegistry);
            services.SetServiceIfNone <ISparkViewEngine>(new SparkViewEngine());
            services.SetServiceIfNone <ICacheService>(new DefaultCacheService(HttpRuntime.Cache));

            services.FillType <IActivator, SparkActivator>();

            services.FillType <IRenderStrategy, NestedRenderStrategy>();
            services.FillType <IRenderStrategy, AjaxRenderStrategy>();
            services.FillType <IRenderStrategy, DefaultRenderStrategy>();

            services.SetServiceIfNone <IViewEntryProviderCache, ViewEntryProviderCache>();
            services.SetServiceIfNone <IViewModifierService, ViewModifierService>();

            services.FillType <IViewModifier, PageActivation>();
            services.FillType <IViewModifier, SiteResourceAttacher>();
            services.FillType <IViewModifier, ContentActivation>();
            services.FillType <IViewModifier, OnceTableActivation>();
            services.FillType <IViewModifier, OuterViewOutputActivator>();
            services.FillType <IViewModifier, NestedViewOutputActivator>();
            services.FillType <IViewModifier, ViewContentDisposer>();
            services.FillType <IViewModifier, NestedOutputActivation>();

            services.SetServiceIfNone <IHtmlEncoder, DefaultHtmlEncoder>();

            services.SetServiceIfNone(new DefaultViewDefinitionPolicy());
            services.SetServiceIfNone <IViewDefinitionResolver, ViewDefinitionResolver>();
        }
コード例 #10
0
 public static void FillType <TInterface, TConcrete>(this IServiceRegistry registry) where TConcrete : TInterface
 {
     registry.FillType(typeof(TInterface), typeof(TConcrete));
 }
 public void Register(IEnumerable<Type> matchedTypes, IServiceRegistry services)
 {
     matchedTypes
         .Where(t => _pluginType.IsAssignableFrom(t) && t.IsClass && !t.IsAbstract)
         .Each(t => services.FillType(_pluginType, t));
 }