Click or drag to resize
UpdateControllerShowCheckForUpdateDialog Method (IWin32Window, ErrorDisplayLevel)
Searches for an available update while showing a modal dialog to the user that can show the specified amount of error information in front of the specified object.

Namespace: Kjs.AppLife.Update.Controller
Assembly: Kjs.AppLife.Update.Controller (in Kjs.AppLife.Update.Controller.dll) Version: 5.1.0.9 (5.1.0.9)
Syntax
public DialogResult ShowCheckForUpdateDialog(
	IWin32Window owner,
	ErrorDisplayLevel errorDisplayLevel
)

Parameters

owner
Type: System.Windows.FormsIWin32Window
An implementation of IWin32Window that will own the modal dialog.
errorDisplayLevel
Type: Kjs.AppLife.Update.ControllerErrorDisplayLevel
One of the ErrorDisplayLevel values indicating how much error detail can be shown to the user.

Return Value

Type: DialogResult
DialogResult.OK if an update was found and the user clicked the "Get update" button; otherwise, DialogResult.Cancel.
Exceptions
ExceptionCondition
InvalidEnumArgumentExceptionerrorDisplayLevel is not a valid ErrorDisplayLevel value.
InvalidOperationExceptionIsBusy is .
ObjectDisposedException

The UpdateController has been disposed.

Remarks

This method downloads director.xml from UpdateLocation and scans it for an available update. This method blocks while the dialog is displayed. To check for updates and continue executing while waiting for the check to complete, use CheckForUpdateAsync. To check for updates without showing a dialog, use CheckForUpdate.

If an update is found, the dialog will allow the user to choose to either get the update or cancel the operation. If the user chooses to get the update, this method returns DialogResult.OK, but the update is not automatically downloaded; you must call DownloadUpdate, DownloadUpdateAsync, or ShowDownloadUpdateDialog to download the update.

If an exception is thrown while checking for an update, the dialog will display a simple error message to the user. If errorDisplayLevel is ShowExceptionMessage, the user can click a button to view the message of the exception and any inner exceptions by clicking a "Show details" button.

If an error occurs, the user cancels the check, no update is found, or the dialog is closed without the user clicking the "Get update" button, this method returns DialogResult.Cancel.

If an update is found, the dialog shows the update's HistoricalSummaryText by default. If no update is found, the dialog shows NoUpdateDisplayText by default. To change the text displayed in the dialog, add an event handler to the UpdateDialogShowing event.

The highest-versioned update that can be applied to the current application version (as indicated by Version) will be selected by default. To filter updates, add an event handler to the UpdateFound event.

See Also