示例#1
0
        /// <summary>
        /// This method handles notifying the user if an update to the product is available.
        /// </summary>
        private void NotifyUser(Boolean displayUI)
        {
            if (IsUpdateAvailable)
            {
                String message = null;

                // Hijacking Fiddler's form because it's nice :)
                if (LatestVersionEngine.CompareTo(CurrentVersionEngine) > 0)
                {
                    message = String.Format("Version {0} of the Watcher Engine is available.\r\n{1}", LatestVersionEngine, LatestVersionReleaseNotes);
                }

                Fiddler.frmAlert alert = new Fiddler.frmAlert("Update(s) Available", message, "Would you like to download them now?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button1);
                alert.StartPosition = FormStartPosition.CenterScreen;
                alert.ShowDialog();
                if (alert.DialogResult == DialogResult.Yes)
                {
                    Fiddler.Utilities.LaunchHyperlink("http://websecuritytool.codeplex.com/");
                }
            }
            else if (displayUI)
            {
                MessageBox.Show("There are no new updates to Watcher available.", "Software Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
示例#2
0
        /// <summary>
        /// This method handles notifying the user if an update to the product is available.
        /// </summary>
        private void NotifyUser(Boolean displayUI)
        {
            if (IsUpdateAvailable)
            {
                String message = null;

                // Hijacking Fiddler's form because it's nice :)
                if (LatestVersionEngine.CompareTo(CurrentVersionEngine) > 0)
                {
                    message = String.Format("Version {0} of {1} is available.\r\n{2}", LatestVersionEngine, _productName, LatestVersionReleaseNotes);
                }

                //Fiddler.frmAlert alert = new Fiddler.frmAlert("Update(s) Available", message, "Would you like to download them now?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button1);
                //alert.StartPosition = FormStartPosition.CenterScreen;
                //alert.ShowDialog();
                //if (alert.DialogResult == DialogResult.Yes)
                //{
                //    Fiddler.Utilities.LaunchHyperlink(_downloadURI);
                //}
            }
            else if (displayUI)
            {
                MessageBox.Show("There are no new updates available.", "Software Update", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }