private void backgroundWorkerBuildStatus_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (CancelRequest == true && backgroundWorkerAddFsIsBusy == false && backgroundWorkerFsListIsBusy == false && backgroundWorkerPkgFlagsIsBusy == false) { CancelRequest = false; return; } if (CancelRequest == true) { return; } if (backgroundWorkerAddFs.CancellationPending == true || CancelRequest == true) { return; } foreach (PkgBuildStatus item in CtrColl.Values) { item.CleanAll(); item.Dispose(); } CtrColl.Clear(); tableLayoutPaneBuildStatus.Height = 10; tableLayoutPaneBuildStatus.Controls.Clear(); foreach (Dictionary <string, string> Repos in AllRepo) { if (backgroundWorkerAddFs.CancellationPending == true || CancelRequest == true) { break; } List <string> Archs = new List <string>(); #pragma warning disable 0219 string Repository = string.Empty; string Project = string.Empty; string ItemInfo = string.Empty; foreach (string KeyName in Repos.Keys) { if (backgroundWorkerAddFs.CancellationPending == true || CancelRequest == true) { break; } if (KeyName.StartsWith("arch", StringComparison.CurrentCultureIgnoreCase) == true) { Archs.Add(Repos[KeyName]); } switch (KeyName) { case "repository": Repository = Repos[KeyName]; break; case "project": Project = Repos[KeyName]; break; case "ItemInfo": ItemInfo = Repos[KeyName]; break; default: break; } } if (CancelRequest == true) { return; } PkgBuildStatus TheCtrl = new PkgBuildStatus(ItemInfo, Archs, Package); tableLayoutPaneBuildStatus.Controls.Add(TheCtrl); tableLayoutPaneBuildStatus.Height += TheCtrl.Height + 6; TheCtrl.Dock = DockStyle.Top; CtrColl.Add(TheCtrl.Handle.ToString(), TheCtrl); } VarGlobal.NetEvManager.DoSomething("List of packages Done"); if (backgroundWorkerPkgFlags.IsBusy == false && CancelRequest == false) { backgroundWorkerPkgFlags.RunWorkerAsync(); } backgroundWorkerBuildStatusIsBusy = false; }