示例#1
0
        public TestApp()
        {
            UiWasCreated = false;
            var ioc = new DependencyInjectionContainer();

            QlServiceCollection = ioc.Create();

            QlServiceCollection.AddModule(new InfrastructureModule());
            QlServiceCollection.AddModule(new AntlrModule());
            QlServiceCollection.AddModule(new EntitiesModule());
            QlServiceCollection.AddModule(new OrchestrationModule());
            QlServiceCollection.AddModule(new UiModule());
            QlServiceCollection.AddSingleton(typeof(IServiceProvider), x => m_serviceProvider);
            m_serviceProvider = QlServiceCollection.BuildServiceProvider(true);
        }
示例#2
0
        private static void InitializeModules()
        {
            var ioc = new DependencyInjectionContainer();

            QlServiceCollection = ioc.Create();

            QlServiceCollection.AddModule(new InfrastructureModule());
            QlServiceCollection.AddModule(new AntlrModule());
            QlServiceCollection.AddModule(new OrchestrationModule());
            m_serviceProvider   = QlServiceCollection.BuildServiceProvider(true);
            m_domainItemLocator = m_serviceProvider.GetService <IDomainItemLocator>();
            m_qprint            = m_serviceProvider.GetService <IQuestionnairePrinter>();
            m_qprint.Writer     = Console.Out;
            m_bprint            = m_serviceProvider.GetService <IBooleanLogicPrinter>();
            m_bprint.Writer     = Console.Out;
        }
示例#3
0
        public IServiceCollection Bootstrap()
        {
            var ioc        = new DependencyInjectionContainer();
            var collection = ioc.Create();

            collection.AddModule(new InfrastructureModule());
            collection.AddModule(new AntlrModule());
            collection.AddModule(new EntitiesModule());
            collection.AddModule(new OrchestrationModule());
            collection.AddModule(new UiModule());
            collection.AddTransient(
                typeof(IQuestionnaireViewModel),
                typeof(QuestionnaireViewModel));
            collection.AddSingleton(
                typeof(IQuestionnaireDataProvider),
                typeof(QuestionnaireDataProvider));

            return(collection);
        }
示例#4
0
        public IServiceCollection Bootstrap()
        {
            var ioc        = new DependencyInjectionContainer();
            var collection = ioc.Create();

            collection.AddModule(new InfrastructureModule());
            collection.AddModule(new AntlrModule());
            collection.AddModule(new EntitiesModule());
            collection.AddModule(new OrchestrationModule());
            collection.AddModule(new UiModule());

            collection.AddSingleton(typeof(IEventAggregator), typeof(EventAggregator));
            collection.AddTransient(typeof(INavigationViewModel), typeof(NavigationViewModel));
            collection.AddTransient(typeof(IQuestionnaireViewModel), typeof(QuestionnaireViewModel));
            collection.AddSingleton(typeof(IMainViewModel), typeof(MainViewModel));
            collection.AddSingleton(typeof(IMessageDialogService), typeof(MessageDialogService));

            return(collection);
        }