Updates the user interface.
Namespace: Kjs.AppLife.Update.Engine.CoreAssembly: Kjs.AppLife.Update.Engine.Core (in Kjs.AppLife.Update.Engine.Core.dll) Version: 1.0.0.12 (4.0.0.0)
Syntaxvoid Update(
UpdateUIState uiState,
UpdateState updateState,
string description,
int progressValue,
int progressMaximum
)
Sub Update (
uiState As UpdateUIState,
updateState As UpdateState,
description As String,
progressValue As Integer,
progressMaximum As Integer
)
void Update(
UpdateUIState uiState,
UpdateState updateState,
String^ description,
int progressValue,
int progressMaximum
)
abstract Update :
uiState : UpdateUIState *
updateState : UpdateState *
description : string *
progressValue : int *
progressMaximum : int -> unit
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:
uiState will be set to Extracting.
The update files are extracted. During this step, the updateState,
progressValue and progressMaximum parameters are not
valid.
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.
ExamplesThis 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:
Name | Description |
---|
label | A Label that is used to show a description of the update's current state
to the user. |
progressBar | A 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;
}
}
Private Sub Update(ByVal uiState As UpdateUIState, ByVal updateState As UpdateState, _
ByVal description As String, ByVal progressValue As Integer, ByVal progressMaximum As Integer)
If uiState = UpdateUIState.Paused Then
label.Text = "Paused"
Else
label.Text = description
End If
If uiState = UpdateUIState.Extracting Then
progressBar.Style = ProgressBarStyle.Marquee
Else
progressBar.Style = ProgressBarStyle.Continuous
progressBar.Maximum = progressMaximum
progressBar.Value = progressValue
End If
End Sub
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also