private bool _isBankCacheLoaded; //Used to help set the progress bar to a proper length public MainForm() { InitializeComponent(); splitContainer1.Visible = false; _bankInfoLoader = new BankInfoLoader(); _mapInfoCache = new MapInfoCache(_bankInfoLoader); //Create a progress bar and show it on the form _progressBarControl = new ProgressBarControl(); this.Controls.Add(_progressBarControl); _progressBarControl.Dock = DockStyle.Fill; _progressBarControl.BringToFront(); _progressBarControl.Visible = true; }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (_mapList.Any()) { RefreshListBox(); splitContainer1.Visible = true; } else { MessageBox.Show("Warning: No maps found. Is Starcraft II installed?", "No maps found", MessageBoxButtons.OK, MessageBoxIcon.Warning); } //Hide progress bar and remove floating references _progressBarControl.Visible = false; this.Controls.Remove(_progressBarControl); _progressBarControl = null; }