Beispiel #1
0
        /// <summary>
        /// Handles the UpdateAvailable event of the au control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void au_UpdateAvailable(object sender, UpdatesAvailableEventArgs e)
        {
            Version ver = au.UpdateInfoList.GetLatestVersion( );
            Thread  t   = new Thread(new ParameterizedThreadStart(GetUpdates));

            t.Start(ver);
        }
        /// <summary>
        /// Handles the UpdateAvailable event of the applicationUpdater control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="UpdatesAvailableEventArgs"/> instance containing the event data.</param>
        void applicationUpdater_UpdateAvailable(object sender, UpdatesAvailableEventArgs e)
        {
            ApplicationUpdater ai = (ApplicationUpdater)sender;

            if (ai.UpdatesAvailable)
            {
                // hide the splash if its visible
                Util.HideSplashScreen( );
                UpdateInformationForm uif = new UpdateInformationForm(ai);
                if (uif.ShowDialog(_owner) == DialogResult.OK)
                {
                    string thisPath   = this.GetType( ).Assembly.Location;
                    string attrString = string.Format(CCNetConfig.Core.Util.UserSettings.UpdateSettings.LaunchArgumentsFormat, CCNetConfig.Core.Util.UserSettings.UpdateSettings.UpdateCheckType, thisPath, ai.UpdateInfoList.GetLatestVersion( ), string.Empty);
                    Console.WriteLine(attrString);
                    Process.Start(Path.Combine(Application.StartupPath, CCNetConfig.Core.Util.UserSettings.UpdateSettings.UpdaterApplication), attrString);
                    Application.Exit( );
                }
            }
        }