Click or drag to resize
IUpdateUIUpdate Method
Updates the user interface.

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
void Update(
	UpdateUIState uiState,
	UpdateState updateState,
	string description,
	int progressValue,
	int progressMaximum
)

Parameters

uiState
Type: Kjs.AppLife.Update.Engine.CoreUpdateUIState
One of the UpdateUIState values, indicating the operation currently taking place.
updateState
Type: Kjs.AppLife.Update.Engine.CoreUpdateState
If uiState is Updating or Paused, the current state of the update being applied. If uiState is Extracting, this value is not valid.
description
Type: SystemString
A description of the current state of the UI.
progressValue
Type: SystemInt32
If uiState is Updating or Paused, the current progress value. If uiState is Extracting, this value is not valid.
progressMaximum
Type: SystemInt32
If uiState is Updating or Paused, the maximum progress value. If uiState is Extracting, this value is not valid.
Remarks

This is the primary method used to display an update UI. Updates happen in two steps:

  1. uiState will be set to Extracting.

    The update files are extracted. During this step, the updateState, progressValue and progressMaximum parameters are not valid.

  2. uiState can be set to either Updating or Paused.

    The update is applied. During this step, the updateState value will change to describe the current task being performed, and the progressValue and progressMaximum values will indicate the current progress of the update.

Any time this method is called, the UI should update itself to display the current state of the update.
Examples
This example shows a sample implementation of the Update(UpdateUIState, UpdateState, String, Int32, Int32) method. It takes place in a form that has the following controls defined:
NameDescription
labelA Label that is used to show a description of the update's current state to the user.
progressBarA ProgressBar that is used to show how far along the update is to the user.
private void Update(UpdateUIState uiState, UpdateState updateState, string description,
    int progressValue, int progressMaximum) {

    if(uiState == UpdateUIState.Paused) {
        label.Text = "Paused";
    } else {
        label.Text = description;
    }
    if(uiState == UpdateUIState.Extracting) {
        progressBar.Style = ProgressBarStyle.Marquee;
    } else {
        progressBar.Style = ProgressBarStyle.Continuous;
        progressBar.Maximum = progressMaximum;
        progressBar.Value = progressValue;
    }
}
See Also