UpdateControllerCheckForUpdateAsync Method |
Namespace: Kjs.AppLife.Update.Controller
Exception | Condition |
---|---|
InvalidOperationException | IsBusy is . |
DownloadException | An error occurres while downloading director.xml. -or- The downloaded director.xml file cannot be read. Check InnerException for the error that occurred. |
ValidationException | The downloaded director.xml file is not valid. -or- The downloaded director.xml file's application ID does not match ApplicationId. Check InnerException for the error that occurred. |
ObjectDisposedException | The UpdateController has been disposed. |
This method downloads director.xml from UpdateLocation and scans it for an available update. The work is done asynchronously using thread resources that are automatically allocated from the thread pool. To receive notification when the check is complete, add an event handler to the CheckForUpdateCompleted event.
This method does not block the calling thread while the check is being performed. To block while checking for updates, use CheckForUpdate or ShowCheckForUpdateDialog.
You can use the CancelAsync method to cancel asynchronous operations that have not been completed.
The highest-versioned update that can be applied to the current application version (as specified by Version) will be selected by default. To filter updates, add an event handler to the UpdateFound event.
When the check is complete, the CheckForUpdateCompletedEventArgs passed to handlers of the CheckForUpdateCompleted event will have its Result set to the result of the check. If Result is , CurrentUpdate will contain a reference to an UpdateInformation class containing information about the selected update; if Result is , CurrentUpdate will be . Either way, NoUpdateDisplayText will contain the text specified on the update server for display if no update is available.