예제 #1
0
 void CurrentDeployment_UpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e)
 {
     try
     {
         Helper.EnsureThreadLocalized();
         if (e.State == DeploymentProgressState.DownloadingApplicationFiles)
         {
             splashScreen.SetStatus(string.Format(Strings.SplashScreen_DownloadingNewVersion,
                                                  Helper.FormatBytes(e.BytesCompleted),
                                                  Helper.FormatBytes(e.BytesTotal), updateInfo.AvailableVersion));
             splashScreen.SetProgressBar(true, (int)e.BytesTotal, (int)e.BytesCompleted);
         }
         else
         {
             splashScreen.SetStatus(string.Format(Strings.SplashScreen_NewVersionFound, updateInfo.AvailableVersion));
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler.Default.Process(ex);
     }
 }
예제 #2
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));
            }
        }