public void Register(IContainerRegister container)
        {
            container
            .RegisterPerRequestScope <IControllerResponseHelper, ControllerResponseHelper>()

            .RegisterPerRequestScope <ISettingsViewHelper, SettingsViewHelper>()
            .RegisterPerRequestScope <ICurrentUserViewHelper, CurrentUserViewHelper>()
            .RegisterPerRequestScope <IPageTemplateViewFileLocator, PageTemplateViewFileLocator>()
            .RegisterPerRequestScope <IHtmlSanitizerHelper, HtmlSanitizerHelper>()
            .RegisterPerRequestScope <IPageViewModelMapper, PageViewModelMapper>()
            .RegisterPerRequestScope <IJavascriptViewHelper, JavascriptViewHelper>()
            .RegisterPerRequestScope <ICofoundryHtmlHelper, CofoundryHtmlHelper>()
            .RegisterPerRequestScope <IUserSessionService, UserSessionService>()

            .RegisterPerRequestScope <IApiResponseHelper, ApiResponseHelper>()

            .RegisterAll <IPageModuleViewLocationRegistration>()
            .RegisterAll <IModelMetaDataDecorator>()

            .RegisterInstance <ModelMetadataProvider, CofoundryModelMetadataProvider>()
            .RegisterInstance <IAntiCSRFService, AntiCSRFService>()

            .RegisterType <ICustomEntityTemplateSectionTagBuilderFactory, CustomEntityTemplateSectionTagBuilderFactory>()
            .RegisterType <IPageTemplateSectionTagBuilderFactory, PageTemplateSectionTagBuilderFactory>()
            .RegisterType <IPageModuleRenderer, PageModuleRenderer>()
            .RegisterType <IRedirectResponseHelper, RedirectResponseHelper>()
            .RegisterType <IPathResolver, SitePathResolver>(RegistrationOptions.Override(RegistrationOverridePriority.Low))
            .RegisterType <IWebApiStartupConfiguration, WebApiStartupConfiguration>()
            ;
        }
        public void Register(IContainerRegister container)
        {
            var overrideOptions = RegistrationOptions.Override();

            container
            .Register <IPageViewModelFactory, ExamplePageViewModelFactory>(overrideOptions)
            .Register <IPageViewModelBuilder, ExamplePageViewModelBuilder>(overrideOptions)
            ;
        }
        public void Register(IContainerRegister container)
        {
            var overrideOptions = RegistrationOptions.Override();

            container
            .Register <IImageAssetFileService, ImageSharpImageAssetFileService>(overrideOptions)
            .Register <IResizedImageAssetFileService, ImageSharpResizedImageAssetFileService>(overrideOptions)
            ;
        }
Пример #4
0
        public void Register(IContainerRegister container)
        {
            container.Register <IVisualEditorActionResultFactory, VisualEditorActionResultFactory>();
            container.RegisterAll <IVisualEditorRequestExclusionRule>();

            var overrideOptions = RegistrationOptions.Override(RegistrationOverridePriority.Low);

            container.Register <IVisualEditorStateService, AdminVisualEditorStateService>(overrideOptions);
        }
        public void Register(IContainerRegister container)
        {
            if (!container.Configuration.GetValue <bool>("Cofoundry:Azure:Disabled"))
            {
                var overrideOptions = RegistrationOptions.Override();

                container
                .Register <IFileStoreService, AzureBlobFileService>(overrideOptions);
            }
        }
Пример #6
0
    public void Register(IContainerRegister container)
    {
        if (container.Configuration.GetValue <bool>("Cofoundry:Plugins:SendGrid:Disabled"))
        {
            return;
        }

        var overrideOptions = RegistrationOptions.Override();

        container
        .Register <IMailDispatchSession, SendGridMailDispatchSession>(overrideOptions)
        ;
    }
        public void Register(IContainerRegister container)
        {
            if (container.Configuration.GetValue <bool>("Cofoundry:Plugins:AmazonSes:Disabled"))
            {
                return;
            }

            var overrideOptions = RegistrationOptions.Override();

            container
            .Register <IMailDispatchService, AmazonSesMailDispatchService>(overrideOptions)
            ;
        }
        public void Register(IContainerRegister container)
        {
            var singletonRegistrationOptions                 = RegistrationOptions.SingletonScope();
            var lowPriorityOverrideRegistrationOptions       = RegistrationOptions.Override(RegistrationOverridePriority.Low);
            var lowPriorityScopedOverrideRegistrationOptions = RegistrationOptions.Override(RegistrationOverridePriority.Low);

            lowPriorityScopedOverrideRegistrationOptions.Lifetime = InstanceLifetime.Scoped;

            container
            .Register <IControllerResponseHelper, ControllerResponseHelper>()

            .Register <ISettingsViewHelper, SettingsViewHelper>()
            .Register <ICurrentUserViewHelper, CurrentUserViewHelper>(RegistrationOptions.Scoped())
            .Register <IPageTemplateViewFileLocator, PageTemplateViewFileLocator>()
            .Register <IHtmlSanitizerHelper, HtmlSanitizerHelper>()
            .Register <IJavascriptViewHelper, JavascriptViewHelper>()
            .Register <ICofoundryHtmlHelper, CofoundryHtmlHelper>()
            .Register <IUserSessionService, WebUserSessionService>(lowPriorityScopedOverrideRegistrationOptions)
            .Register <IAuthCookieNamespaceProvider, AuthCookieNamespaceProvider>()
            .Register <IAuthorizationHandler, UserAreaAuthorizationHandler>()
            .Register <IAuthorizationHandler, RoleAuthorizationHandler>()
            .Register <IAuthorizationHandler, PermissionAuthorizationHandler>()
            .Register <IVisualEditorStateService, DefaultVisualEditorStateService>()
            .Register <IVisualEditorStateCache, VisualEditorStateCache>(RegistrationOptions.Scoped())

            .Register <IPageViewModelMapper, PageViewModelMapper>()
            .Register <IPageViewModelFactory, PageViewModelFactory>()
            .Register <IPageViewModelBuilder, PageViewModelBuilder>()

            .Register <IApiResponseHelper, ApiResponseHelper>()

            .Register <ICustomEntityTemplateRegionTagBuilderFactory, CustomEntityTemplateRegionTagBuilderFactory>()
            .Register <IPageTemplateRegionTagBuilderFactory, PageTemplateRegionTagBuilderFactory>()
            .Register <IPageBlockRenderer, PageBlockRenderer>()
            .Register <IPathResolver, SitePathResolver>(lowPriorityOverrideRegistrationOptions)
            .Register <IClientConnectionService, WebClientConnectionService>(lowPriorityOverrideRegistrationOptions)

            .Register <JsonDeltaModelBinder>()

            .RegisterAll <IRouteRegistration>()
            .Register <IRouteInitializer, RouteInitializer>()
            .Register <IResourceLocator, WebsiteResourceLocator>(lowPriorityOverrideRegistrationOptions)
            .Register <IEmptyActionContextFactory, EmptyActionContextFactory>()
            .RegisterFactory <IStaticResourceFileProvider, StaticResourceFileProvider, StaticResourceFileProviderFactory>(singletonRegistrationOptions)

            .Register <IClaimsPrincipalFactory, ClaimsPrincipalFactory>()
            .Register <IClaimsPrincipalValidator, ClaimsPrincipalValidator>()
            .Register <IClaimsPrincipalBuilderContextRepository, ClaimsPrincipalBuilderContextRepository>()
            ;
        }
        public void Register(IContainerRegister container)
        {
            if (container.Configuration.GetValue <bool>("Cofoundry:Plugins:MailKit:Disabled"))
            {
                return;
            }

            var overrideOptions = RegistrationOptions.Override();

            container
            .Register <IMailDispatchService, MailKitMailDispatchService>(overrideOptions)
            .Register <ISmtpClientConnectionConfiguration, SmtpClientConnectionConfiguration>()
            ;
        }
Пример #10
0
        public void Register(IContainerRegister container)
        {
            var singletonRegistrationOptions           = RegistrationOptions.SingletonScope();
            var lowPriorityOverrideRegistrationOptions = RegistrationOptions.Override(RegistrationOverridePriority.Low);

            container
            .Register <IControllerResponseHelper, ControllerResponseHelper>()

            .Register <ISettingsViewHelper, SettingsViewHelper>()
            .Register <ICurrentUserViewHelper, CurrentUserViewHelper>(RegistrationOptions.Scoped())
            .Register <IPageTemplateViewFileLocator, PageTemplateViewFileLocator>()
            .Register <IHtmlSanitizerHelper, HtmlSanitizerHelper>()
            .Register <IJavascriptViewHelper, JavascriptViewHelper>()
            .Register <ICofoundryHtmlHelper, CofoundryHtmlHelper>()
            .Register <IUserSessionService, UserSessionService>(RegistrationOptions.Scoped())
            .Register <IAuthCookieNamespaceProvider, AuthCookieNamespaceProvider>()
            .Register <IVisualEditorStateService, DefaultVisualEditorStateService>()
            .Register <IVisualEditorStateCache, VisualEditorStateCache>(RegistrationOptions.Scoped())

            .Register <IPageViewModelMapper, PageViewModelMapper>()
            .Register <IPageViewModelFactory, PageViewModelFactory>()
            .Register <IPageViewModelBuilder, PageViewModelBuilder>()

            .Register <IApiResponseHelper, ApiResponseHelper>()

            .Register <ICustomEntityTemplateRegionTagBuilderFactory, CustomEntityTemplateRegionTagBuilderFactory>()
            .Register <IPageTemplateRegionTagBuilderFactory, PageTemplateRegionTagBuilderFactory>()
            .Register <IPageBlockRenderer, PageBlockRenderer>()
            .Register <IPathResolver, SitePathResolver>(lowPriorityOverrideRegistrationOptions)

            .Register <JsonDeltaModelBinder>()
            .Register <IFormFileUploadedFileFactory, FormFileUploadedFileFactory>()

            .RegisterAll <IRouteRegistration>()
            .Register <IRouteInitializer, RouteInitializer>()
            .Register <IResourceLocator, WebsiteResourceLocator>(lowPriorityOverrideRegistrationOptions)
            .Register <IEmptyActionContextFactory, EmptyActionContextFactory>()
            .RegisterFactory <IStaticResourceFileProvider, StaticResourceFileProvider, StaticResourceFileProviderFactory>(singletonRegistrationOptions)
            ;
        }