public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator, 
            PageTypeBuilderConfiguration configuration, 
            PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine,
            PageTypeDefinitionValidator pageTypeDefinitionValidator,
            PageTypeResolver pageTypeResolver,
            IPageTypeLocator pageTypeLocator,
            PageTypeUpdater pageTypeUpdater,
            TabDefinitionUpdater tabDefinitionUpdater,
            TabLocator tabLocator,
            GlobalPropertySettingsSynchronizer globalPropertySettingsSynchronizer,
            IHooksHandler hooksHandler)
        {
            _configuration = configuration;
            this.pageTypeResolver = pageTypeResolver;
            TabLocator = tabLocator;
            TabDefinitionUpdater = tabDefinitionUpdater;

            using (new TimingsLogger("Getting page type definitions"))
            {
                _pageTypeDefinitions = pageTypeDefinitionLocator.GetPageTypeDefinitions();
            }

            PageTypeUpdater = pageTypeUpdater;
            PageDefinitionSynchronizationEngine = pageDefinitionSynchronizationEngine;
            PageTypeDefinitionValidator = pageTypeDefinitionValidator;
            _pageTypeLocator = pageTypeLocator;
            this.globalPropertySettingsSynchronizer = globalPropertySettingsSynchronizer;
            this.hooksHandler = hooksHandler;
        }
        public void GivenPageType_UpdatePageTypePropertyDefinitions_CallsPageTypePropertyUpdaterUpdatePageTypePropertyDefinitions()
        {
            PageTypeDefinition definition = new PageTypeDefinition();

            MockRepository  fakes           = new MockRepository();
            PageTypeUpdater pageTypeUpdater = PageTypeUpdaterFactory.Stub(fakes);
            IPageType       pageType        = new NativePageType();
            PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine = PageDefinitionSynchronizationEngineFactory.Stub(fakes);

            pageDefinitionSynchronizationEngine.Stub(updater => updater.UpdatePageTypePropertyDefinitions(pageType, definition));
            pageDefinitionSynchronizationEngine.Replay();
            IPageTypeLocator pageTypeLocator = fakes.Stub <IPageTypeLocator>();

            pageTypeLocator.Stub(locator => locator.GetExistingPageType(definition)).Return(pageType);
            pageTypeLocator.Replay();
            List <PageTypeDefinition> definitions = new List <PageTypeDefinition> {
                definition
            };
            PageTypeSynchronizer synchronizer =
                PageTypeSynchronizerFactory.Create(pageDefinitionSynchronizationEngine, pageTypeLocator);

            synchronizer.PageTypeUpdater = pageTypeUpdater;
            synchronizer.UpdatePageTypePropertyDefinitions(definitions);

            pageDefinitionSynchronizationEngine.AssertWasCalled(updater => updater.UpdatePageTypePropertyDefinitions(pageType, definition));
        }
Ejemplo n.º 3
0
 protected internal virtual void UpdatePageTypePropertyDefinitions(IEnumerable <PageTypeDefinition> pageTypeDefinitions)
 {
     foreach (PageTypeDefinition definition in pageTypeDefinitions)
     {
         IPageType pageType = _pageTypeLocator.GetExistingPageType(definition);
         PageDefinitionSynchronizationEngine.UpdatePageTypePropertyDefinitions(pageType, definition);
     }
 }
 public static PageTypeSynchronizer Create(PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine, PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator)
 {
     return new PageTypeSynchronizer(
         PageTypeDefinitionLocatorFactory.Create(),
         new PageTypeBuilderConfiguration(),
         pageDefinitionSynchronizationEngine,
         new PageTypeDefinitionValidator(new PageDefinitionTypeMapper(new PageDefinitionTypeRepository(), new NativePageDefinitionsMap())),
         pageTypeResolver,
         pageTypeLocator,
         PageTypeUpdaterFactory.Create(),
         TabDefinitionUpdaterFactory.Create(),
         TabLocatorFactory.Create(),
         new GlobalPropertySettingsSynchronizer(() => new PropertySettingsRepository(), new GlobalPropertySettingsLocator(new AppDomainAssemblyLocator())),
         new HooksHandler(new AppDomainAssemblyLocator()));
 }
Ejemplo n.º 5
0
 public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator,
                             PageTypeBuilderConfiguration configuration,
                             PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine,
                             PageTypeDefinitionValidator pageTypeDefinitionValidator,
                             PageTypeResolver pageTypeResolver,
                             IPageTypeLocator pageTypeLocator,
                             PageTypeUpdater pageTypeUpdater,
                             TabDefinitionUpdater tabDefinitionUpdater,
                             TabLocator tabLocator,
                             GlobalPropertySettingsSynchronizer globalPropertySettingsSynchronizer,
                             IHooksHandler hooksHandler)
 {
     _configuration        = configuration;
     this.pageTypeResolver = pageTypeResolver;
     TabLocator            = tabLocator;
     TabDefinitionUpdater  = tabDefinitionUpdater;
     _pageTypeDefinitions  = pageTypeDefinitionLocator.GetPageTypeDefinitions();
     PageTypeUpdater       = pageTypeUpdater;
     PageDefinitionSynchronizationEngine = pageDefinitionSynchronizationEngine;
     PageTypeDefinitionValidator         = pageTypeDefinitionValidator;
     _pageTypeLocator = pageTypeLocator;
     this.globalPropertySettingsSynchronizer = globalPropertySettingsSynchronizer;
     this.hooksHandler = hooksHandler;
 }
 public static PageTypeSynchronizer Create(PageDefinitionSynchronizationEngine pageDefinitionSynchronizationEngine, IPageTypeLocator pageTypeLocator)
 {
     return Create(pageDefinitionSynchronizationEngine, new PageTypeResolver(), pageTypeLocator);
 }