Esempio n. 1
0
        static ValidationResult Setup(SplashScreen splashScreen)
        {
            var validator = new SPFInstalledValidator();

            if (validator.RunValidator() == ValidationResult.Error)
            {
                MessageBox.Show(validator.ErrorString + Environment.NewLine + Environment.NewLine + validator.QuestionString, SPMEnvironment.Version.Title + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(ValidationResult.Error);
            }


            var builder = new ContainerBuilder();

            // Find all the assemblies for this application
            builder.RegisterModule(new AutoLoadAssemblies());

            // Build the container now!
            autoFacContainer = builder.Build();
            //CompositionProvider.LoadAssemblies();

            IoCContainer = autoFacContainer.Resolve <IContainerAdapter>();


            var provider = IoCContainer.Resolve <SettingsProvider>();

            provider.Load();

            var engine = new PreflightController(splashScreen, IoCContainer);

            if (!engine.Validate())
            {
                return(ValidationResult.Error);
            }

            Window = IoCContainer.Resolve <MainWindow>();
            Window.SplashScreenLoad(splashScreen);


            return(ValidationResult.Success);
        }
Esempio n. 2
0
        static ValidationResult Setup(SplashScreen splashScreen)
        {
            var validator = new SPFInstalledValidator();

            if (validator.RunValidator() == ValidationResult.Error)
            {
                MessageBox.Show(validator.ErrorString+Environment.NewLine+Environment.NewLine+validator.QuestionString, SPMEnvironment.Version.Title + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return ValidationResult.Error;
            }

            var builder = new ContainerBuilder();

            // Find all the assemblies for this application
            builder.RegisterModule(new AutoLoadAssemblies());

            // Build the container now!
            autoFacContainer = builder.Build();
            //CompositionProvider.LoadAssemblies();

            IoCContainer = autoFacContainer.Resolve<IContainerAdapter>();

            var provider = IoCContainer.Resolve<SettingsProvider>();
            provider.Load();

            var engine = new PreflightController(splashScreen, IoCContainer);
            if (!engine.Validate())
            {
                return ValidationResult.Error;
            }

            Window = IoCContainer.Resolve<MainWindow>();
            Window.SplashScreenLoad(splashScreen);

            return ValidationResult.Success;
        }