Exemple #1
0
        private static void InitalizeApplication(string[] args, SimpleInjectorPrismApplication application)
        {
            var resolver           = new SimpleInjectorAppStartResolver(_container);
            var appStartFactory    = new AppStartFactory(resolver, _container.GetInstance <IPathUtil>(), _container.GetInstance <IDirectConversionHelper>());
            var appStart           = appStartFactory.CreateApplicationStart(args);
            var helpCommandHandler = _container.GetInstance <HelpCommandHandler>();
            var settingsManager    = _container.GetInstance <ISettingsManager>();

            application.InitApplication(appStart, helpCommandHandler, settingsManager);
            application.DispatcherUnhandledException += Application_DispatcherUnhandledException;
        }
Exemple #2
0
        private static int StartApplication(string[] args, Func <Bootstrapper> getBootstrapperFunc)
        {
            Application.EnableVisualStyles();

            Thread.CurrentThread.Name = "ProgramThread";

            InitializeLogging();
            Logger.Debug("Starting PDFCreator");

            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            var application = new SimpleInjectorPrismApplication(_container);

            BootstrapContainerAndApplication(getBootstrapperFunc(), application);

            InitalizeApplication(args, application);

            VerifyContainer();

            return(application.Run());
        }
Exemple #3
0
        private static void BootstrapContainerAndApplication(Bootstrapper bootstrapper, SimpleInjectorPrismApplication application)
        {
            bootstrapper.RegisterMainApplication(_container);
            bootstrapper.RegisterPrismNavigation(_container);
            SetupObsidian(bootstrapper);

            application.Initialize();

            bootstrapper.RegisterEditionDependentRegions(_container.GetInstance <IRegionManager>());
        }