Ejemplo n.º 1
0
    void versionChecker_CheckVersionComplete(object sender, CheckVersionCompleteEventArgs e)
    {
      string latestVersionText = "";

      if (string.IsNullOrEmpty(e.Version))
        latestVersionText = "Unable to check version.";
      else if (e.New)
        latestVersionText = "New version available!";
      else
        latestVersionText = "You have the latest version.";

      this.Dispatcher.Invoke(new Action(() =>
      {
        Run run = new Run(latestVersionText);
        LatestVersion.Inlines.Clear();
        LatestVersion.Inlines.Add(run);
      }), System.Windows.Threading.DispatcherPriority.Normal);
    }
Ejemplo n.º 2
0
        void versionChecker_CheckVersionComplete(object sender, CheckVersionCompleteEventArgs e)
        {
            string latestVersionText = "";

            if (string.IsNullOrEmpty(e.Version))
            {
                latestVersionText = "Unable to check version.";
            }
            else if (e.New)
            {
                latestVersionText = "New version available!";
            }
            else
            {
                latestVersionText = "You have the latest version.";
            }

            this.Dispatcher.Invoke(new Action(() => { LatestVersion.Text = latestVersionText; }), System.Windows.Threading.DispatcherPriority.Normal);
        }
Ejemplo n.º 3
0
        void versionChecker_CheckVersionComplete(object sender, CheckVersionCompleteEventArgs e)
        {
            if (!e.New)
            {
                return;
            }

            string title   = "Update Toastify!";
            string caption = "Version " + e.Version + " available now.";

            // this is a background thread, so sleep it a bit so that it doesn't clash with the startup toast
            System.Threading.Thread.Sleep(20000);

            this.Dispatcher.Invoke((Action) delegate
            {
                Title1.Text = title;
                Title2.Text = caption;

                toastIcon = "SpotifyToastifyUpdateLogo.png";

                FadeIn(force: true, isUpdate: true);
            }, System.Windows.Threading.DispatcherPriority.Normal);
        }