private void Flow(IProgressWindow prgWin) { prgWin.AppendLog("获取信息中", 10); IUpdateInfo info = InfoGetter.Get(); prgWin.AppendLog("获取信息完毕,正在解析", 20); prgWin.SetUpdateContent(info.UpdateContent); IEnumerable <IFile> needUpdateFile = Differ.Diff(info.Files, GetLocalFiles()); if (needUpdateFile.Count() == 0) { prgWin.AppendLog("无需更新!", 100); Thread.Sleep(4000); prgWin.Finish(); return; } int downloadingFile = 0; Downloader.DownloadedAFile += (s, e) => { downloadingFile++; prgWin.SetProgress(20 + (100 / needUpdateFile.Count() * downloadingFile * 80)); prgWin.AppendLog($"正在下载并更新{downloadingFile}/{needUpdateFile.Count()}"); }; Downloader.Download(needUpdateFile); prgWin.AppendLog("结束,三秒后退出", 100); Thread.Sleep(3000); prgWin.Finish(); }
public void SetProgress(int value) { pleaseWaitDlg.SetProgress(value); }