update projects (versions, nuget, references)
This commit is contained in:
@@ -12,66 +12,20 @@ namespace Pilz.Updating.Client.GUI
|
||||
|
||||
public void SetCurrentState(UpdateStatus curAction)
|
||||
{
|
||||
SetCurrentStateInternal(curAction, -1);
|
||||
}
|
||||
|
||||
public void SetCurrentState(UpdateStatus curAction, int progress)
|
||||
{
|
||||
SetCurrentStateInternal(curAction, progress);
|
||||
}
|
||||
|
||||
private void SetCurrentStateInternal(UpdateStatus curAction, int progress)
|
||||
{
|
||||
var progressText = string.Empty;
|
||||
|
||||
switch (curAction)
|
||||
string progressText = curAction switch
|
||||
{
|
||||
case UpdateStatus.Waiting:
|
||||
{
|
||||
progressText = UpdatingClientGuiLangRes.SimpleActions_Waiting;
|
||||
break;
|
||||
}
|
||||
UpdateStatus.Waiting => UpdatingClientGuiLangRes.SimpleActions_Waiting,
|
||||
UpdateStatus.Searching => UpdatingClientGuiLangRes.SimpleActions_Searching,
|
||||
UpdateStatus.DownloadingPackage => UpdatingClientGuiLangRes.SimpleActions_DownloadingPackage,
|
||||
UpdateStatus.DownloadingInstaller => UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller,
|
||||
UpdateStatus.StartingInstaller => UpdatingClientGuiLangRes.SimpleActions_StartingInstaller,
|
||||
_ => string.Empty,
|
||||
};
|
||||
|
||||
case UpdateStatus.Searching:
|
||||
{
|
||||
progressText = UpdatingClientGuiLangRes.SimpleActions_Searching;
|
||||
break;
|
||||
}
|
||||
|
||||
case UpdateStatus.DownloadingInstaller:
|
||||
{
|
||||
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
|
||||
break;
|
||||
}
|
||||
|
||||
case UpdateStatus.DownloadingPackage:
|
||||
{
|
||||
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingPackage;
|
||||
break;
|
||||
}
|
||||
|
||||
case UpdateStatus.StartingInstaller:
|
||||
{
|
||||
progressText = UpdatingClientGuiLangRes.SimpleActions_DownloadingInstaller;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (progress == -1)
|
||||
{
|
||||
radProgressBar1.Visible = false;
|
||||
radWaitingBar1.Text = progressText;
|
||||
radWaitingBar1.BringToFront();
|
||||
radWaitingBar1.StartWaiting();
|
||||
}
|
||||
else
|
||||
{
|
||||
radWaitingBar1.StopWaiting();
|
||||
radProgressBar1.Text = progressText + $" ({progress}%)";
|
||||
radProgressBar1.Value1 = progress;
|
||||
radProgressBar1.BringToFront();
|
||||
radProgressBar1.Visible = true;
|
||||
}
|
||||
radProgressBar1.Visible = false;
|
||||
radWaitingBar1.Text = progressText;
|
||||
radWaitingBar1.BringToFront();
|
||||
radWaitingBar1.StartWaiting();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user