Ejemplo n.º 1
0
        private async void Application_Startup(object sender, StartupEventArgs e)
        {
            this.Dispatcher.UnhandledException += DispatcherOnUnhandledException;
            var loadingWindow = new LoadingWindow();

            loadingWindow.Show(null, MiscStrings.CheckingConfiguration, MiscStrings.Initialising);
            var initResult = await BootStrap.CheckConfigurationAndInit();

            _container = initResult.container;
            if (!initResult.ConfigResult.Success)
            {
                MessageBox.Show(string.Join(Environment.NewLine, initResult.ConfigResult.Errors),
                                MiscStrings.LoadErrorCaption);
                Shutdown();
                return;
            }
            loadingWindow.SetStatus(MiscStrings.CheckingForNewVersion);
            var release = await _container.GetInstance <IVersionChecker>().GetLatestVersion();

            if (release.NewVersion)
            {
                MessageBox.Show(release.Release.ChangeLog, "New version " + release.Release.TagName + " is available!");
            }
            loadingWindow.Hide();
            _container.Configure(c => c.For <ILoadingWindow>().Use(loadingWindow).Singleton());
            var windowProvider = _container.GetInstance <IWindowProvider>();

            windowProvider.CreateWindow <IDeployment>().Show();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Starting in console mode...");
            var initResult = BootStrap.CheckConfigurationAndInit().GetAwaiter().GetResult();

            if (!initResult.ConfigResult.Success)
            {
                initResult.container.Configure(c =>
                {
                    c.For <IConsoleDoJob>().Use <ConsoleDoJob>();
                });
                System.Console.Write(string.Join(Environment.NewLine, initResult.ConfigResult.Errors));
                return;
            }
            var container = initResult.container;

            Parser.Default.ParseArguments <OctoPlusOptions>(args).WithParsed(opts => RunConsole(container, opts));
        }