Click or drag to resize
IUpdateUI Interface
Defines an update's user interface. A class implementing IUpdateUI will be created during an update and used by AppLife Update to inform a user about the update's status.

Namespace: Kjs.AppLife.Update.Engine.Core
Assembly: Kjs.AppLife.Update.Engine.Core (in Kjs.AppLife.Update.Engine.Core.dll) Version: 1.0.0.12 (4.0.0.0)
Syntax
public interface IUpdateUI

The IUpdateUI type exposes the following members.

Methods
  NameDescription
Public methodClose
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.
Public methodFinish
Notifies the UI that the update has finished and allows it to be closed.
Public methodOpen
Displays the user interface. The UI should remain visible until the Finish(UpdateResult, String, Exception) method has been called.
Public methodShowYesNoPrompt
Causes the user interface to display a yes/no prompt with the specified message.
Public methodCode exampleUpdate
Updates the user interface.
Top
Events
  NameDescription
Public eventClosed
Raised when the UI has been closed. This event must be raised in order for the AppLife updater to shut down.
Public eventRequestCancel

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.

Public eventRequestPause

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.

Public eventRequestResume

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.

Top
Remarks

An update user interface should contain at least the following elements:

  • A message area.
  • Progress indication.
  • A way to cancel the update.
In addition, the user interface should have some way to allow a user to select yes or no in response to a question.

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

See Also