加载增加进度条
This commit is contained in:
@@ -142,7 +142,22 @@ namespace WinISP
|
|||||||
#else
|
#else
|
||||||
string debugversion = "";
|
string debugversion = "";
|
||||||
#endif
|
#endif
|
||||||
|
private bool _isStartupInitializing = false;
|
||||||
private void FormISP_MSI_Load(object sender, EventArgs e)
|
private void FormISP_MSI_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
BeginStartupLoadingAnimation();
|
||||||
|
BeginInvoke(new Action(InitializeAfterFormLoaded));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InitializeAfterFormLoaded()
|
||||||
|
{
|
||||||
|
if (_isStartupInitializing)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_isStartupInitializing = true;
|
||||||
|
try
|
||||||
{
|
{
|
||||||
UpdateNumofConnectedMonitor();
|
UpdateNumofConnectedMonitor();
|
||||||
// lblDisplayNumber.Text = _numberOfMonitors.ToString();
|
// lblDisplayNumber.Text = _numberOfMonitors.ToString();
|
||||||
@@ -175,6 +190,12 @@ namespace WinISP
|
|||||||
_lastNumOfMonitors = _numberOfMonitors;
|
_lastNumOfMonitors = _numberOfMonitors;
|
||||||
Application.Idle += Application_Idle;
|
Application.Idle += Application_Idle;
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
EndStartupLoadingAnimation();
|
||||||
|
_isStartupInitializing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FormISP_MSI_Shown(object sender, EventArgs e)
|
private void FormISP_MSI_Shown(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -238,6 +259,23 @@ namespace WinISP
|
|||||||
return Environment.TickCount & Int32.MaxValue;
|
return Environment.TickCount & Int32.MaxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BeginStartupLoadingAnimation()
|
||||||
|
{
|
||||||
|
prbProgress.Style = ProgressBarStyle.Marquee;
|
||||||
|
prbProgress.MarqueeAnimationSpeed = 30;
|
||||||
|
SetStatusMsg("程序加载中,请稍候...");
|
||||||
|
btnAuto.Enabled = false;
|
||||||
|
btnLoadFile.Enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EndStartupLoadingAnimation()
|
||||||
|
{
|
||||||
|
prbProgress.MarqueeAnimationSpeed = 0;
|
||||||
|
prbProgress.Style = ProgressBarStyle.Blocks;
|
||||||
|
prbProgress.Value = 0;
|
||||||
|
btnLoadFile.Enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnUpdateProgress(int total, int done, String msg)
|
private void OnUpdateProgress(int total, int done, String msg)
|
||||||
{
|
{
|
||||||
if (msg != String.Empty)
|
if (msg != String.Empty)
|
||||||
|
|||||||
Reference in New Issue
Block a user