UpdateControllerUpdateInteractive Method (IWin32Window, ErrorDisplayLevel, ApplyUpdateOptions, IDictionary) |
Namespace: Kjs.AppLife.Update.Controller
public void UpdateInteractive( IWin32Window dialogOwner, ErrorDisplayLevel errorDisplayLevel, ApplyUpdateOptions options, IDictionary initialSharedProperties )
Exception | Condition |
---|---|
InvalidEnumArgumentException | errorDisplayLevel is not a valid ErrorDisplayLevel value. -or- options represents a combination of flags not defined in the ApplyUpdateOptions enumeration. |
ArgumentException | options contains both the NoUpdateWindow and AutoClose values. |
InvalidOperationException | IsBusy is . |
ObjectDisposedException | The UpdateController has been disposed. |
This method combines the functionality of ShowCheckForUpdateDialog and ShowDownloadUpdateDialog and adds a step to automatically attempt to apply the update and display any error that occurs when doing so to the user.
This method displays a "Check for updates" dialog. If an update is found and the user chooses to get it, this method will automatically download it and display a progress dialog. If the download succeeds and is not cancelled by the user, this method will apply the update. If the update is successfully applied, the application will shut down.
If an exception is thrown during any of these steps, a simple message will be shown 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 initialSharedProperties is specified, the dictionary and all keys and values in it must be serializable types referenced in the update. For example, using a Hashtable for the dictionary and strings for the keys and values will work, but using a value that is an instance of a custom type in the current application will only work if the assembly containing that type is part of the update and included as a reference (either as a custom action assembly or as a dynamic action reference).
To access values in initialSharedProperties from Set Shared Property actions or in Action Conditions, their keys must be strings.