/// <summary>
        /// Registers a <see cref="Views.ViewManagerEventDispatcher"/> to manage the given views. Can be called multiple times in order to register
        /// multiple "pools" of views (each will be managed by a dedicated worker thread).
        /// </summary>
        public ViewManagerEventDispatcherConfiguationBuilder UseViewManagerEventDispatcher(params IViewManager[] viewManagers)
        {
            var viewManagerConfigurationContainer = new ConfigurationContainer();

            UseEventDispatcher(context =>
            {
                var viewManagerContext = viewManagerConfigurationContainer.CreateContext();

                context.AddChildContext(viewManagerContext);

                var eventDispatcher = new ViewManagerEventDispatcher(
                    context.Get <IAggregateRootRepository>(),
                    context.Get <IEventStore>(),
                    context.Get <IDomainEventSerializer>(),
                    context.Get <IDomainTypeNameMapper>(),
                    viewManagers);

                var waitHandle = viewManagerContext.GetOrDefault <ViewManagerWaitHandle>();
                if (waitHandle != null)
                {
                    waitHandle.Register(eventDispatcher);
                }

                var maxDomainEventsPerBatch = viewManagerContext.GetOrDefault <int>();
                if (maxDomainEventsPerBatch > 0)
                {
                    eventDispatcher.MaxDomainEventsPerBatch = maxDomainEventsPerBatch;
                }

                var viewManagerProfiler = viewManagerContext.GetOrDefault <IViewManagerProfiler>();
                if (viewManagerProfiler != null)
                {
                    eventDispatcher.SetProfiler(viewManagerProfiler);
                }

                return(eventDispatcher);
            });

            return(new ViewManagerEventDispatcherConfiguationBuilder(viewManagerConfigurationContainer));
        }
 internal void InsertResolversInto(ConfigurationContainer otherContainer)
 {
     otherContainer._resolvers.AddRange(_resolvers);
 }