Пример #1
0
        public static void Setup(out IDefinitionProvider[] definitionProviders, out IDefinitionManager definitions, out ContentActivator activator, out IItemNotifier notifier, out InterceptingProxyFactory proxyFactory, params Type[] itemTypes)
        {
            var map = new DefinitionMap();

            definitionProviders = SetupDefinitionProviders(map, itemTypes);
            notifier            = new ItemNotifier();
            proxyFactory        = new InterceptingProxyFactory();
            activator           = new ContentActivator(new N2.Edit.Workflow.StateChanger(), notifier, proxyFactory);
            definitions         = new DefinitionManager(definitionProviders, activator, new StateChanger(), new DefinitionMap());
            ((DefinitionManager)definitions).Start();
        }
Пример #2
0
        public static void Setup(out IDefinitionManager definitions, out ContentActivator activator, out IItemNotifier notifier, out InterceptingProxyFactory proxyFactory, params Type[] itemTypes)
        {
            ITypeFinder typeFinder = new Fakes.FakeTypeFinder(itemTypes[0].Assembly, itemTypes);

            DefinitionBuilder definitionBuilder = new DefinitionBuilder(typeFinder, new EngineSection());

            notifier     = new ItemNotifier();
            proxyFactory = new InterceptingProxyFactory();
            activator    = new ContentActivator(new N2.Edit.Workflow.StateChanger(), notifier, proxyFactory);
            definitions  = new DefinitionManager(new [] { new DefinitionProvider(definitionBuilder) }, activator);
            ((DefinitionManager)definitions).Start();
        }
Пример #3
0
        public static void Setup(out IDefinitionManager definitions, out ITemplateAggregator templates, out ContentActivator activator, params Type[] itemTypes)
        {
            var map = new DefinitionMap();
            var definitionProviders = SetupDefinitionProviders(map, itemTypes);
            var notifier            = new ItemNotifier();
            var proxyFactory        = new InterceptingProxyFactory();

            activator   = new ContentActivator(new N2.Edit.Workflow.StateChanger(), notifier, proxyFactory);
            definitions = new DefinitionManager(definitionProviders, activator, new StateChanger(), new DefinitionMap());
            templates   = new TemplateAggregator(definitions, new[] { new TemplateProvider(activator, map) });
            ((IAutoStart)definitions).Start();
            ((IAutoStart)templates).Start();
        }
Пример #4
0
        public static void Setup(out IDefinitionProvider[] definitionProviders, out IDefinitionManager definitions, out ContentActivator activator, out IItemNotifier notifier, out InterceptingProxyFactory proxyFactory, params Type[] itemTypes)
        {
            ITypeFinder typeFinder = new Fakes.FakeTypeFinder(itemTypes[0].Assembly, itemTypes);

            DefinitionBuilder definitionBuilder = new DefinitionBuilder(new DefinitionMap(), typeFinder, new TransformerBase <IUniquelyNamed> [0], SetupEngineSection());

            notifier            = new ItemNotifier();
            proxyFactory        = new InterceptingProxyFactory();
            activator           = new ContentActivator(new N2.Edit.Workflow.StateChanger(), notifier, proxyFactory);
            definitionProviders = new IDefinitionProvider[] { new DefinitionProvider(definitionBuilder) };
            definitions         = new DefinitionManager(definitionProviders, new ITemplateProvider[0], activator, new StateChanger());
            ((DefinitionManager)definitions).Start();
        }
        public void SetUp()
        {
            notifier = new ItemNotifier();

            var container = GetContainer();

            container.AddComponent("a", typeof(EntityDependencySetter <>), typeof(EntityDependencySetter <>));
            container.AddComponentInstance("b", typeof(IUrlParser), MockRepository.GenerateStub <IUrlParser>());
            container.AddComponentInstance("c", typeof(IServiceContainer), container);
            container.AddComponentInstance("d", typeof(IItemNotifier), notifier);

            injector = new ContentDependencyInjector(container, TestSupport.SetupDefinitions(typeof(InjectableItem)), notifier);
            injector.Start();
        }
Пример #6
0
        public override void SetUp()
        {
            base.SetUp();

            activator = new ContentActivator(stateChanger = new N2.Edit.Workflow.StateChanger(), notifier = new ItemNotifier(), new InterceptingProxyFactory());
            activator.Initialize(new[] { new ItemDefinition(typeof(Definitions.PersistableItem)), new ItemDefinition(typeof(Definitions.PersistableItem1b)) });
        }
Пример #7
0
        public override void SetUp()
        {
            base.SetUp();

            activator = new ContentActivator(stateChanger = new N2.Edit.Workflow.StateChanger(), notifier = new ItemNotifier(), new EmptyProxyFactory());
        }
Пример #8
0
 public override void SetUp()
 {
     base.SetUp();
     notifier   = new ItemNotifier();
     repository = new XmlContentRepository(definitions, new ThreadContext(), new XmlFileSystem(new ConfigurationManagerWrapper()), writer, reader, notifier);
 }