rebuild UI of Pilz.Updating.Client.GUI

This commit is contained in:
2022-06-11 11:38:25 +02:00
parent dab01d9ed7
commit c7f0098c20
8 changed files with 899 additions and 1082 deletions

View File

@@ -24,47 +24,55 @@ namespace Pilz.Updating.Client.GUI
private void SetCurrentStateInternal(UpdateStatus curAction, int progress)
{
var progressText = string.Empty;
switch (curAction)
{
case UpdateStatus.Waiting:
{
LabelX_Progress.Text = UpdatingClientGuiLangRes.SimpleActions_Waiting;
progressText = UpdatingClientGuiLangRes.SimpleActions_Waiting;
break;
}
case UpdateStatus.Searching:
{
LabelX_Progress.Text = UpdatingClientGuiLangRes.SimpleActions_Searching;
progressText = UpdatingClientGuiLangRes.SimpleActions_Searching;
break;
}
case UpdateStatus.DownloadingInstaller:
{
LabelX_Progress.Text = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
break;
}
case UpdateStatus.DownloadingPackage:
{
LabelX_Progress.Text = UpdatingClientGuiLangRes.SimpleActions_DownloadingPackage;
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingPackage;
break;
}
case UpdateStatus.StartingInstaller:
{
LabelX_Progress.Text = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
break;
}
}
if (progress == -1)
{
ProgressBarX_Progress.ProgressType = eProgressItemType.Marquee;
radProgressBar1.Visible = false;
radWaitingBar1.Text = progressText;
radWaitingBar1.BringToFront();
radWaitingBar1.StartWaiting();
}
else
{
ProgressBarX_Progress.ProgressType = eProgressItemType.Standard;
ProgressBarX_Progress.Value = progress;
radWaitingBar1.StopWaiting();
radProgressBar1.Text = progressText + $" ({progress}%)";
radProgressBar1.Value1 = progress;
radProgressBar1.BringToFront();
radProgressBar1.Visible = true;
}
}
}