private void BtnUpdate_Click(object sender, EventArgs e) { Lottery lot = CreateLottery((int)cbxLotteries.SelectedIndex); using (WebClient wc = new WebClient()) { tslblLotteryName.Text = string.Format("Downloading winning numbers from {0}", lot.Name); wc.DownloadProgressChanged += Wc_DownloadProgressChanged; wc.DownloadFileCompleted += Wc_DownloadFileCompleted; wc.DownloadFileAsync(new Uri(lot.Url), lot.FilePath); } }
private void LoadAndBindNumbers() { tslblLotteryName.Text = string.Format("Loading {0}'s numbers from file", cbxLotteries.SelectedText); lottery = CreateLottery(cbxLotteries.SelectedIndex); toolStripProgressBar.Value = 0; lottery.LoadNumbers(toolStripProgressBar); lottery.Bind(dgvDrawings, bindingSource); gbxSpecialNumber.Text = lottery.ColumnSpecs.GetColumSpec(ColumnHeader.SpecialNumber.ToString()).Header; gbxSpecialPlay.Text = lottery.ColumnSpecs.GetColumSpec(ColumnHeader.SpecialPlay.ToString()).Header; tslblLotteryName.Text = string.Empty; toolStripProgressBar.Value = 0; UpdateNumberOccurrences(); CleanGeneratedNumbers(); }