IUpdateUI Interface |
Namespace: Kjs.AppLife.Update.Engine.Core
The IUpdateUI type exposes the following members.
Name | Description | |
---|---|---|
![]() | Close |
Closes the user interface. This method will only be called after Finish(UpdateResult, String, Exception),
and only if the update was started with the AutoClose flag set in the UpdateController.
|
![]() | Finish |
Notifies the UI that the update has finished and allows it to be closed.
|
![]() | Open |
Displays the user interface. The UI should remain visible until the Finish(UpdateResult, String, Exception)
method has been called.
|
![]() | ShowYesNoPrompt |
Causes the user interface to display a yes/no prompt with the specified message.
|
![]() ![]() | Update |
Updates the user interface.
|
Name | Description | |
---|---|---|
![]() | Closed |
Raised when the UI has been closed. This event must be raised in order for the AppLife updater
to shut down.
|
![]() | RequestCancel | Raised when the user tries to cancel the update. The update will not be cancelled immediately; once it is cancelled, Finish(UpdateResult, String, Exception) will be called with its result parameter set to Cancelled. If the update was nearly finished when RequestCancel was raised, the update may finish anyway and not be canceled. |
![]() | RequestPause | Raised when the update should be paused. The udpate will not be paused immediately; once it is paused, Update(UpdateUIState, UpdateState, String, Int32, Int32) will be called with its uiState parameter set to Paused. If the update was nearly finished when RequestPause was raised, the update may simply finish and not be paused. |
![]() | RequestResume | Raised when a paused update should be resumed. The udpate may not be resumed immediately; once it is resumed, Update(UpdateUIState, UpdateState, String, Int32, Int32) will be called with its uiState parameter set to Updating. If the update was nearly finished when RequestPause was raised, the update may simply finish and not be paused. |
An update user interface should contain at least the following elements:
Once a user interface has been opened (shown to the user with the Open(UpdateUIContext) method), it should not be closed until after Finish(UpdateResult, String, Exception) is called.
The Closed event must be raised when the UI has been closed in order for the updater to properly shut down.
A working example of an implementation of this interface can be found in the "Custom Forms" quick start.
AppLife Update uses a multi-threaded updater. However, both Windows Forms and Windows Presentation Foundation (WPF) require components to be updated from the same thread where they were created. If you show a Form or a WPF Window in your implementation of the Open(UpdateUIContext) method, AppLife Update will ensure that all calls to your implementation of IUpdateUI are made from the same thread. Otherwise, you will have to ensure that any updates to your visual components are made on the correct thread using their thread-marshaling APIs. For more information, see:
(Windows Forms) http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invokerequired.aspx
and
(WPF) http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.checkaccess.aspx