private void Browser_ConfigurationDownloadFinished(bool success, string filePath = null)
        {
            if (success)
            {
                var communication = runtime.RequestReconfiguration(filePath);

                if (communication.Success)
                {
                    logger.Info($"Sent reconfiguration request for '{filePath}' to the runtime.");

                    splashScreen = uiFactory.CreateSplashScreen(appConfig);
                    splashScreen.SetIndeterminate();
                    splashScreen.UpdateStatus(TextKey.OperationStatus_InitializeSession, true);
                    splashScreen.Show();
                }
                else
                {
                    logger.Error($"Failed to communicate reconfiguration request for '{filePath}'!");
                    messageBox.Show(TextKey.MessageBox_ReconfigurationError, TextKey.MessageBox_ReconfigurationErrorTitle, icon: MessageBoxIcon.Error);
                }
            }
            else
            {
                logger.Error($"Failed to download configuration file '{filePath}'!");
                messageBox.Show(TextKey.MessageBox_ConfigurationDownloadError, TextKey.MessageBox_ConfigurationDownloadErrorTitle, icon: MessageBoxIcon.Error);
            }
        }
Exemplo n.º 2
0
        public void Terminate()
        {
            DeregisterEvents();

            if (SessionIsRunning)
            {
                StopSession();
            }

            logger.Unsubscribe(runtimeWindow);
            runtimeWindow?.Close();

            splashScreen = uiFactory.CreateSplashScreen(appConfig);
            splashScreen.Show();

            logger.Log(string.Empty);
            logger.Info("Initiating shutdown procedure...");

            var success = bootstrapSequence.TryRevert() == OperationResult.Success;

            if (success)
            {
                logger.Info("Application successfully finalized.");
                logger.Log(string.Empty);
            }
            else
            {
                logger.Info("Shutdown procedure failed!");
                logger.Log(string.Empty);

                messageBox.Show(TextKey.MessageBox_ShutdownError, TextKey.MessageBox_ShutdownErrorTitle, icon: MessageBoxIcon.Error, parent: splashScreen);
            }

            splashScreen.Close();
        }
        public void Terminate()
        {
            logger.Log(string.Empty);
            logger.Info("Initiating shutdown procedure...");

            splashScreen = uiFactory.CreateSplashScreen(appConfig);
            actionCenter.Close();
            taskbar.Close();

            DeregisterEvents();

            var success = operations.TryRevert() == OperationResult.Success;

            if (success)
            {
                logger.Info("Application successfully finalized.");
                logger.Log(string.Empty);
            }
            else
            {
                logger.Info("Shutdown procedure failed!");
                logger.Log(string.Empty);
            }

            splashScreen.Close();
        }
 internal ClientController(
     IActionCenter actionCenter,
     IApplicationMonitor applicationMonitor,
     ClientContext context,
     IDisplayMonitor displayMonitor,
     IExplorerShell explorerShell,
     IFileSystemDialog fileSystemDialog,
     IHashAlgorithm hashAlgorithm,
     ILogger logger,
     IMessageBox messageBox,
     IOperationSequence operations,
     IRuntimeProxy runtime,
     Action shutdown,
     ISplashScreen splashScreen,
     ITaskbar taskbar,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.actionCenter       = actionCenter;
     this.applicationMonitor = applicationMonitor;
     this.context            = context;
     this.displayMonitor     = displayMonitor;
     this.explorerShell      = explorerShell;
     this.fileSystemDialog   = fileSystemDialog;
     this.hashAlgorithm      = hashAlgorithm;
     this.logger             = logger;
     this.messageBox         = messageBox;
     this.operations         = operations;
     this.runtime            = runtime;
     this.shutdown           = shutdown;
     this.splashScreen       = splashScreen;
     this.taskbar            = taskbar;
     this.text      = text;
     this.uiFactory = uiFactory;
 }
 internal RuntimeController(
     AppConfig appConfig,
     ILogger logger,
     IMessageBox messageBox,
     IOperationSequence bootstrapSequence,
     IRepeatableOperationSequence sessionSequence,
     IRuntimeHost runtimeHost,
     IRuntimeWindow runtimeWindow,
     IServiceProxy service,
     SessionContext sessionContext,
     Action shutdown,
     ISplashScreen splashScreen,
     IText text,
     IUserInterfaceFactory uiFactory)
 {
     this.appConfig         = appConfig;
     this.bootstrapSequence = bootstrapSequence;
     this.logger            = logger;
     this.messageBox        = messageBox;
     this.runtimeHost       = runtimeHost;
     this.runtimeWindow     = runtimeWindow;
     this.sessionSequence   = sessionSequence;
     this.service           = service;
     this.sessionContext    = sessionContext;
     this.shutdown          = shutdown;
     this.splashScreen      = splashScreen;
     this.text      = text;
     this.uiFactory = uiFactory;
 }
Exemplo n.º 6
0
 private void ShowSplash()
 {
     var splashScreenWindow = new SplashView();
     SplashScreen = splashScreenWindow;
     splashScreenWindow.Show();
     _resetSplashCreated.Set();
     Dispatcher.Run();
 }
Exemplo n.º 7
0
 /// ------------------------------------------------------------------------------------
 public void ShowSplashScreen()
 {
     if (_splashScreen == null)
     {
         _splashScreen = new SplashScreen();
         _splashScreen.ShowWithoutFade();
     }
 }
Exemplo n.º 8
0
 public GameUI(IGame game, ISplashScreen splashScreen, IRaceViewer raceViewer, IBookieInput bookieInput, IPayoutDisplay payoutDisplay)
 {
     this.game          = game;
     this.splashScreen  = splashScreen;
     this.raceViewer    = raceViewer;
     this.bookieInput   = bookieInput;
     this.payoutDisplay = payoutDisplay;
 }
        private static void ShowSplash()
        {
            SplashWindow wnd = new SplashWindow();

            SplashScreen = wnd;
            wnd.Show();
            resetSplash.Set();
            Dispatcher.Run();
        }
        private static void ShowMessage(object msg)
        {
            MessageWindow wnd = new MessageWindow(msg.ToString());

            MessageScreen = wnd;
            wnd.Show();
            resetSplash.Set();
            Dispatcher.Run();
        }
Exemplo n.º 11
0
        private void ShowSplash()
        {
            AnimatedSplashScreenWindow window = new AnimatedSplashScreenWindow();

            splashScreen = window;
            window.Show();
            this.ResetSplashCreated.Set();
            Dispatcher.Run();
        }
Exemplo n.º 12
0
        private void ShowSplash()
        {
            var splashScreenWindow = new SplashView();

            SplashScreen = splashScreenWindow;
            splashScreenWindow.Show();
            _resetSplashCreated.Set();
            Dispatcher.Run();
        }
Exemplo n.º 13
0
        /// ------------------------------------------------------------------------------------
        public void CloseSplashScreen()
        {
            if (_splashScreen != null)
            {
                _splashScreen.Close();
            }

            _splashScreen = null;
        }
Exemplo n.º 14
0
 public Engine(IFileSystem fileSystem, ICommandFactory commandFactory, ICommandLineExecutor commandLineExecutor,
               IVariableHelper variableHelper, ILogger logger, ISplashScreen splashScreen)
 {
     _fileSystem          = fileSystem;
     _commandFactory      = commandFactory;
     _commandLineExecutor = commandLineExecutor;
     _variableHelper      = variableHelper;
     _logger       = logger;
     _splashScreen = splashScreen;
 }
Exemplo n.º 15
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var splashScreenThread = new SplashScreenThread <SplashScreenWindow>();

            SplashScreen = splashScreenThread.Start();             // returns after splash window is created
            var w = App.Current.MainWindow;

            // continue with normal startup
            base.OnStartup(e);
        }
Exemplo n.º 16
0
        private void ShowSplash()
        {
            ProgressWait animatedSplashScreenWindow = new ProgressWait();
            splashScreen = animatedSplashScreenWindow;
            animatedSplashScreenWindow.Show();

            resetSplashCreated.Set();

            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 17
0
        private void ShowSplash()
        {
            // Create the window
            AnimatedSplashScreenWindow animatedSplashScreenWindow = new AnimatedSplashScreenWindow();
            splashScreen = animatedSplashScreenWindow;

            // Show it
            animatedSplashScreenWindow.Show();

            // Now that the window is created, allow the rest of the startup to run
            ResetSplashCreated.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 18
0
        private void ShowSplash()
        {
            // Create the window
            SplashWindow splashWin = new SplashWindow();
            StartupScreen = splashWin;

            // Show it
            splashWin.Show();

            // Now that the window is created, allow the rest of the startup to run
            ResetSplashCreated.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 19
0
        private void ShowSplash()
        {
            // Create the window
            AnimatedSplashScreenWindow animatedSplashScreenWindow = new AnimatedSplashScreenWindow();

            _splashScreen = animatedSplashScreenWindow;

            // Show it
            animatedSplashScreenWindow.Show();

            // Now that the window is created, allow the rest of the startup to run
            SplashSyncEvent.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 20
0
        private void ShowSplash()
        {
            // Create the window
            SplashScreenView animatedSplashScreenWindow = new SplashScreenView();

            splashScreen = animatedSplashScreenWindow;

            // Show it
            animatedSplashScreenWindow.Show();

            // Now that the window is created, allow the rest of the startup to run
            ResetSplashCreated.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 21
0
        public static void Main(string[] args)
        {
            App app = new App();

            //register the single instance application
            WpfSingleInstance.Make("C.B.R.", app);

            ISplashScreen splashScreen = SplashScreenManager.CreateSplashScreen(typeof(SplashContent));

            SplashScreenManager.Splash.Message = "Starting...";

            app.InitializeComponent();
            app.Run();
        }
Exemplo n.º 22
0
        private void ShowSplash()
        {
            // Create the window
            SplashWindow splashWin = new SplashWindow();

            StartupScreen = splashWin;

            // Show it
            splashWin.Show();

            // Now that the window is created, allow the rest of the startup to run
            ResetSplashCreated.Set();
            System.Windows.Threading.Dispatcher.Run();
        }
Exemplo n.º 23
0
        ///<summary>Shows the splash screen on a background thread.</summary>
        void StartSplash()
        {
            splashScreen = CreateSplash();
            if (splashScreen == null)
            {
                return;
            }

            var splashThread = new Thread(splashScreen.RunSplash)
            {
                IsBackground = true
            };

            splashThread.SetApartmentState(ApartmentState.STA);
            splashThread.Start();
        }
Exemplo n.º 24
0
        public bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

            splashScreen = uiFactory.CreateSplashScreen();
            operations.ProgressChanged += Operations_ProgressChanged;
            operations.StatusChanged   += Operations_StatusChanged;

            var success = operations.TryPerform() == OperationResult.Success;

            if (success)
            {
                RegisterEvents();
                ShowShell();
                StartBrowser();

                var communication = runtime.InformClientReady();

                if (communication.Success)
                {
                    logger.Info("Application successfully initialized.");
                    logger.Log(string.Empty);
                }
                else
                {
                    success = false;
                    logger.Error("Failed to inform runtime that client is ready!");
                }
            }
            else
            {
                logger.Info("Application startup aborted!");
                logger.Log(string.Empty);
            }

            splashScreen.Close();

            return(success);
        }
Exemplo n.º 25
0
        public bool TryStart()
        {
            logger.Info("Initiating startup procedure...");

            runtimeWindow = uiFactory.CreateRuntimeWindow(appConfig);
            splashScreen  = uiFactory.CreateSplashScreen(appConfig);

            bootstrapSequence.ProgressChanged += BootstrapSequence_ProgressChanged;
            bootstrapSequence.StatusChanged   += BootstrapSequence_StatusChanged;
            sessionSequence.ActionRequired    += SessionSequence_ActionRequired;
            sessionSequence.ProgressChanged   += SessionSequence_ProgressChanged;
            sessionSequence.StatusChanged     += SessionSequence_StatusChanged;

            splashScreen.Show();

            var initialized = bootstrapSequence.TryPerform() == OperationResult.Success;

            if (initialized)
            {
                RegisterEvents();

                logger.Info("Application successfully initialized.");
                logger.Log(string.Empty);
                logger.Subscribe(runtimeWindow);
                splashScreen.Close();

                StartSession();
            }
            else
            {
                logger.Info("Application startup aborted!");
                logger.Log(string.Empty);

                messageBox.Show(TextKey.MessageBox_StartupError, TextKey.MessageBox_StartupErrorTitle, icon: MessageBoxIcon.Error, parent: splashScreen);
            }

            return(initialized && SessionIsRunning);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Sets up and runs the application. The run method shall block until the application is shut down
        /// </summary>
        public int Run()
        {
            using (ComponentContainer ComponentContainer = new ComponentContainer(this.componentRepository))
            {
                ISplashScreen SplashScreen = ComponentContainer.TryResolveInstance <ISplashScreen>() ?? new SplashDummy();

                SplashScreen.Show();
                IApplicationMain ApplicationMain;

                try
                {
                    this.ResolveModules(ComponentContainer);
                    ApplicationMain = ComponentContainer.ResolveInstance <IApplicationMain>(status => SplashScreen.SetStatus(status));
                }
                finally
                {
                    SplashScreen.Hide();
                }

                //Get Main Module
                return(ApplicationMain.Run(ComponentContainer));
            }
        }
Exemplo n.º 27
0
 private void Awake()
 {
     splashScreen = GetComponentInChildren <ISplashScreen>();
 }
Exemplo n.º 28
0
 /// <summary>
 /// Create our light weight startup object
 /// </summary>
 /// <param name="splashScreen">If a custom splash screen was shown, pass it in here</param>
 public CustomApplicationStartupInfo(ISplashScreen splashScreen)
     : base(CodeReadiness.Release, splashScreen)
 {
 }
Exemplo n.º 29
0
 public UpdateManager(ISplashScreen splashScreen)
 {
     // TODO: Complete member initialization
     this.splashScreen = splashScreen;
     setAddRemoveProgramsIcon();
 }