public BeginPrepareUpdates ( AsyncCallback callback, Object state ) : IAsyncResult | ||
callback | AsyncCallback | Callback function to call when done; can be null |
state | Object | Allows the caller to preserve state; can be null |
Результат | IAsyncResult |
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"); } }