CheckForUpdates() public méthode

Check for updates synchronously
public CheckForUpdates ( ) : void
Résultat void
Exemple #1
0
        private void CheckForUpdates_Click(object sender, EventArgs e)
        {
            // Get a local pointer to the UpdateManager instance
            NAppUpdate.Framework.UpdateManager updManager = NAppUpdate.Framework.UpdateManager.Instance;

            if (updManager.State != NAppUpdate.Framework.UpdateManager.UpdateProcessState.NotChecked)
            {
                updManager.CleanUp();
            }

            updManager.CheckForUpdates();
            if (updManager.UpdatesAvailable != 0)
            {
                DialogResult dr = MessageBox.Show(
                    string.Format("Updates are available to your software ({0} total). Do you want to download and prepare them now? You can always do this at a later time.",
                                  updManager.UpdatesAvailable),
                    "Software updates available",
                    MessageBoxButtons.YesNo);

                if (dr == DialogResult.Yes)
                {
                    //NAppUpdate.Framework.UpdateManager.Instance.PrepareUpdates();
                    updManager.BeginPrepareUpdates(OnPrepareUpdatesCompleted, null);
                }
            }
            else
            {
                MessageBox.Show("Your software is up to date");
            }
        }