private void btnStop_Click(object sender, System.EventArgs e) { if (fetcher == null) { return; } btnStop.Enabled = false; fetcher.Stop(); fetcher = null; btnStart.Enabled = true; }
private void btnStart_Click(object sender, System.EventArgs e) { if (fetcher != null) { return; } string token = eBayToken; if (token.Length == 0) { MessageBox.Show("Please enter your eBay token."); return; } btnStart.Enabled = false; fetcher = new ItemFetcher(this, txtLogger, NumThreads, NumCalls, token, this.rampUpCheckBox.Checked); fetcher.FetchCompleteEvent += new GetItemTester.ItemFetcher.FetchCompleteDelegate(fetcher_FetchCompleteEvent); fetcher.Start(); btnStop.Enabled = true; }
private void fetcher_FetchCompleteEvent(object sender, EventArgs e) { if (btnStop.InvokeRequired) { SetButtonCallBack d = new SetButtonCallBack(SetButtonEnabled); this.Invoke(d, new object[] { btnStop, false }); } else { btnStop.Enabled = false; } fetcher = null; if (btnStart.InvokeRequired) { SetButtonCallBack d = new SetButtonCallBack(SetButtonEnabled); this.Invoke(d, new object[] { btnStart, true }); } else { btnStart.Enabled = true; } }
private void btnStart_Click(object sender, System.EventArgs e) { if (fetcher != null) return; string token = eBayToken; if (token.Length == 0) { MessageBox.Show("Please enter your eBay token."); return; } btnStart.Enabled = false; fetcher = new ItemFetcher(this, txtLogger, NumThreads, NumCalls, token, this.rampUpCheckBox.Checked); fetcher.FetchCompleteEvent += new GetItemTester.ItemFetcher.FetchCompleteDelegate(fetcher_FetchCompleteEvent); fetcher.Start(); btnStop.Enabled = true; }
private void btnStop_Click(object sender, System.EventArgs e) { if (fetcher == null) return; btnStop.Enabled = false; fetcher.Stop(); fetcher = null; btnStart.Enabled = true; }