Пример #1
0
        /// <summary>
        /// Callback that handles update checking.
        /// </summary>
        static void UpdateManager_CheckCompleted(object sender, UpdateCheckCompletedEventArgs e)
        {
            if (e.Success && e.Information != null)
            {
                Log.Write("Update check successful (latest version is {0})", e.Information.LatestVersion);

                if (e.Information.IsNewVersionAvailable)
                {
                    Update.ConfirmAndInstall();
                }
            }
            else
            {
                Log.WriteException("Unable to check for updates", e.Error);
            }
        }
Пример #2
0
        void UpdateCheckCompleted(object sender, UpdateCheckCompletedEventArgs e)
        {
            this.Invoke(new Action(() => {
                if (!e.Success || e.Information == null)
                {
                    //TODO
                    MessageBox.Show("Failed to download update info.");
                }
                else if (!e.Information.IsNewVersionAvailable)
                {
                    Program.Update.DisplayInfo();
                }

                progressUpdate.Visible = false;
            }));
        }