public ContentPartHandlerCoordinator(
     IContentPartHandlerResolver contentPartHandlerResolver,
     ITypeActivatorFactory <ContentPart> contentPartFactory,
     ITypeActivatorFactory <ContentField> contentFieldFactory,
     IContentDefinitionManager contentDefinitionManager,
     ILogger <ContentPartHandlerCoordinator> logger)
 {
     _contentPartHandlerResolver = contentPartHandlerResolver;
     _contentPartFactory         = contentPartFactory;
     _contentFieldFactory        = contentFieldFactory;
     _contentDefinitionManager   = contentDefinitionManager;
     _logger = logger;
 }
Esempio n. 2
0
        public ContentPartHandlerCoordinator(
            IContentPartHandlerResolver contentPartHandlerResolver,
            ITypeActivatorFactory <ContentPart> contentPartFactory,
            IEnumerable <IContentPartHandler> partHandlers,
            ITypeActivatorFactory <ContentField> contentFieldFactory,
            IContentDefinitionManager contentDefinitionManager,
            ILogger <ContentPartHandlerCoordinator> logger)
        {
            _contentPartHandlerResolver = contentPartHandlerResolver;
            _contentPartFactory         = contentPartFactory;
            _contentFieldFactory        = contentFieldFactory;
            _partHandlers             = partHandlers;
            _contentDefinitionManager = contentDefinitionManager;

            foreach (var element in partHandlers.Select(x => x.GetType()))
            {
                logger.LogWarning("The content part handler '{ContentPartHandler}' should not be registered in DI. Use AddHandler<T> instead.", element);
            }

            _logger = logger;
        }