Example #1
0
        private void ShowUpgradeAvailableThreadSafe(bool force, string version, string downloadUrl)
        {
            if (this.InvokeRequired)
            {
                var myDelegate = new ShowUpgradeAvailableDelegate(ShowUpgradeAvailableThreadSafe);
                this.BeginInvoke(myDelegate, new object[] { force, version, downloadUrl });
                return;
            }
            string s;

            if (force)
            {
                s = String.Format("You need to update to version {0}.", version);
                MessageBox.Show(s);
                LaunchBrowser(downloadUrl);
                Application.Exit();
            }
            s = String.Format("New version {0} is available. Do you want to update?", version);
            var res = MessageBox.Show(s, "Update available", MessageBoxButtons.YesNo);

            if (DialogResult.Yes == res)
            {
                LaunchBrowser(downloadUrl);
            }
        }
Example #2
0
 private void ShowUpgradeAvailableThreadSafe(bool force, string version, string downloadUrl)
 {
     if (this.InvokeRequired)
     {
         var myDelegate = new ShowUpgradeAvailableDelegate(ShowUpgradeAvailableThreadSafe);
         this.BeginInvoke(myDelegate, new object[] { force, version, downloadUrl });
         return;
     }
     string s;
     if (force)
     {
         s = String.Format("You need to update to version {0}.", version);
         MessageBox.Show(s);
         LaunchBrowser(downloadUrl);
         Application.Exit();
     }
     s = String.Format("New version {0} is available. Do you want to update?", version);
     var res = MessageBox.Show(s, "Update available", MessageBoxButtons.YesNo);
     if (DialogResult.Yes == res)
         LaunchBrowser(downloadUrl);
 }