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;
        }
Exemplo n.º 2
0
        public void GivenPageTypeDefinition_AddPageTypesToResolver_AddsToResolver()
        {
            List <PageTypeDefinition> definitions = new List <PageTypeDefinition>();
            PageTypeDefinition        definition  = new PageTypeDefinition
            {
                Type      = typeof(string),
                Attribute = new PageTypeAttribute()
            };

            definitions.Add(definition);
            IPageType pageType = new NativePageType();

            pageType.ID = 1;
            MockRepository   fakes           = new MockRepository();
            IPageTypeLocator pageTypeLocator = fakes.Stub <IPageTypeLocator>();

            pageTypeLocator.Stub(locator => locator.GetExistingPageType(definition)).Return(pageType);
            pageTypeLocator.Replay();
            PageTypeResolver     resolver     = new PageTypeResolver();
            PageTypeSynchronizer synchronizer = PageTypeSynchronizerFactory.Create(resolver, pageTypeLocator);

            synchronizer.AddPageTypesToResolver(definitions);

            Assert.Equal <Type>(definition.Type, resolver.GetPageTypeType(pageType.ID));
        }
Exemplo n.º 3
0
 protected internal virtual void AddPageTypesToResolver(IEnumerable <PageTypeDefinition> pageTypeDefinitions)
 {
     foreach (PageTypeDefinition definition in pageTypeDefinitions)
     {
         IPageType pageType = _pageTypeLocator.GetExistingPageType(definition);
         PageTypeResolver.AddPageType(pageType.ID, definition.Type);
     }
 }
 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()));
 }
 public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator, 
     PageTypeBuilderConfiguration configuration, 
     PageTypePropertyUpdater pageTypePropertyUpdater,
     PageTypeDefinitionValidator pageTypeDefinitionValidator,
     PageTypeResolver pageTypeResolver,
     IPageTypeLocator pageTypeLocator,
     PageTypeUpdater pageTypeUpdater,
     TabDefinitionUpdater tabDefinitionUpdater,
     TabLocator tabLocator)
 {
     _configuration = configuration;
     PageTypeResolver = pageTypeResolver;
     TabLocator = tabLocator;
     TabDefinitionUpdater = tabDefinitionUpdater;
     _pageTypeDefinitions = pageTypeDefinitionLocator.GetPageTypeDefinitions();
     PageTypeUpdater = pageTypeUpdater;
     PageTypePropertyUpdater = pageTypePropertyUpdater;
     PageTypeDefinitionValidator = pageTypeDefinitionValidator;
     _pageTypeLocator = pageTypeLocator;
 }
Exemplo n.º 6
0
 public PageTypeSynchronizer(IPageTypeDefinitionLocator pageTypeDefinitionLocator,
                             PageTypeBuilderConfiguration configuration,
                             PageTypePropertyUpdater pageTypePropertyUpdater,
                             PageTypeDefinitionValidator pageTypeDefinitionValidator,
                             PageTypeResolver pageTypeResolver,
                             IPageTypeLocator pageTypeLocator,
                             PageTypeUpdater pageTypeUpdater,
                             TabDefinitionUpdater tabDefinitionUpdater,
                             TabLocator tabLocator)
 {
     _configuration              = configuration;
     PageTypeResolver            = pageTypeResolver;
     TabLocator                  = tabLocator;
     TabDefinitionUpdater        = tabDefinitionUpdater;
     _pageTypeDefinitions        = pageTypeDefinitionLocator.GetPageTypeDefinitions();
     PageTypeUpdater             = pageTypeUpdater;
     PageTypePropertyUpdater     = pageTypePropertyUpdater;
     PageTypeDefinitionValidator = pageTypeDefinitionValidator;
     _pageTypeLocator            = pageTypeLocator;
 }
        public void GivenPageTypeDefinition_AddPageTypesToResolver_AddsToResolver()
        {
            
            List<PageTypeDefinition> definitions = new List<PageTypeDefinition>();
            PageTypeDefinition definition = new PageTypeDefinition
                                                {
                                                    Type = typeof(string),
                                                    Attribute = new PageTypeAttribute()
                                                };
            definitions.Add(definition);
            IPageType pageType = new NativePageType();
            pageType.ID = 1;
            MockRepository fakes = new MockRepository();
            IPageTypeLocator pageTypeLocator = fakes.Stub<IPageTypeLocator>();
            pageTypeLocator.Stub(locator => locator.GetExistingPageType(definition)).Return(pageType);
            pageTypeLocator.Replay();
            PageTypeResolver resolver = new PageTypeResolver();
            PageTypeSynchronizer synchronizer = PageTypeSynchronizerFactory.Create(resolver, pageTypeLocator);

            synchronizer.AddPageTypesToResolver(definitions);

            Assert.Equal<Type>(definition.Type, resolver.GetPageTypeType(pageType.ID));
        }
Exemplo n.º 8
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 void Instance_ReturnsInstanceOfPageTypeResolver()
        {
            PageTypeResolver instance = PageTypeResolver.Instance;

            Assert.NotNull(instance);
        }
 public static PageTypeSynchronizer Create(PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator)
 {
     return Create(PageDefinitionSynchronizationEngineFactory.Create(), pageTypeResolver, pageTypeLocator);
 }
 public static PageTypeSynchronizer Create(PageTypeResolver pageTypeResolver, IPageTypeLocator pageTypeLocator)
 {
     return Create(PageDefinitionSynchronizationEngineFactory.Create(), pageTypeResolver, pageTypeLocator);
 }
 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()));
 }