Exemplo n.º 1
0
 private void TriggerCheckFinishedEvent(UpdateCheckEventArgs args)
 {
     if (CheckFinished != null)
     {
         form.InvokeAsyncSafe(() => CheckFinished(this, args));
     }
 }
Exemplo n.º 2
0
        private void updates_CheckFinished(object sender, UpdateCheckEventArgs e)
        {
            UpdateInfo foundUpdate = e.Result.HasValue ? e.Result.Value : null;

            if (nextUpdate != null && !nextUpdate.Equals(foundUpdate))
            {
                nextUpdate.DeleteInstaller();
            }

            nextUpdate = foundUpdate;
        }
Exemplo n.º 3
0
 void checker_UpdateCheckFailed(object sender, UpdateCheckEventArgs e)
 {
     try
     {
         SetUpdateInfo(null, null);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         SetUpdateInfo(null, null);
     }
 }
Exemplo n.º 4
0
 void checker_NoUpdateAvailable(object sender, UpdateCheckEventArgs e)
 {
     try
     {
         SetUpdateInfo(Res.AboutUpdateNotAvailable, null);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         SetUpdateInfo(null, null);
     }
 }
Exemplo n.º 5
0
 void checker_UpdateAvailable(object sender, UpdateCheckEventArgs e)
 {
     try
     {
         SetUpdateInfo(string.Format(Res.AboutUpdateAvailable, e.WebVersion.ToAppFormat()), e.UpdateUrl);
     }
     catch (Exception ex)
     {
         Log.Write(ex);
         SetUpdateInfo(null, null);
     }
 }
Exemplo n.º 6
0
        private void updates_CheckFinished(object sender, UpdateCheckEventArgs e)
        {
            if (e.EventId == updateCheckEventId)
            {
                btnCheckUpdates.Enabled = true;

                if (!e.UpdateAvailable)
                {
                    MessageBox.Show("Your version of " + Program.BrandName + " is up to date.", "No Updates Available", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }
Exemplo n.º 7
0
        private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){
            if (e.EventId == updateCheckEventId){
                btnCheckUpdates.Enabled = true;

                e.Result.Handle(update => {
                    if (update.VersionTag == Program.VersionTag){
                        FormMessage.Information("No Updates Available", "Your version of TweetDuck is up to date.", FormMessage.OK);
                    }
                }, ex => {
                    Program.Reporter.HandleException("Update Check Error", "An error occurred while checking for updates.", true, ex);
                });
            }
        }
Exemplo n.º 8
0
        private void updates_CheckFinished(object sender, UpdateCheckEventArgs e)
        {
            e.Result.Handle(update => {
                string tag = update.VersionTag;

                if (tag != Program.VersionTag && tag != Config.DismissedUpdate)
                {
                    update.BeginSilentDownload();
                    browser.ShowUpdateNotification(tag, update.ReleaseNotes);
                }
                else
                {
                    updates.StartTimer();
                }
            }, ex => {
                if (!ignoreUpdateCheckError)
                {
                    Program.Reporter.HandleException("Update Check Error", "An error occurred while checking for updates.", true, ex);
                    updates.StartTimer();
                }
            });

            ignoreUpdateCheckError = true;
        }