private void cmdGrabPrices_Click(object sender, EventArgs e) { ((Action) delegate() { Gatherer g2 = new Gatherer(); g2.onGatherCardProgress += new Gatherer.GatherCardProgress(g2_onGatherCardProgressEvent); g2.onGatherCardCompleteEvent += new Gatherer.GatherCardCompleteEvent(g2_onGatherCardCompleteEvent); List<string> sets = new List<string>(); if (this.checkedListBox1.CheckedItems.Count > 0) { foreach (string set in this.checkedListBox1.CheckedItems) { SetMeta sm = g2.gatherSetMeta(set); this.Invoke((Action)delegate() { this.progressBar1.Value = 0; this.progressBar1.Maximum = sm.totalCards; }); g2.gatherCardMultiverseIds(Set: set); } } }).BeginInvoke(new AsyncCallback(delegate(IAsyncResult ar) { }), new object()); }
public SetMeta gatherSetMeta(string Set = "") { //messy messy SetMeta result = new SetMeta(); Gatherer g = new Gatherer(); g.onGatherCardProgressEvent += new GatherCardProgressEvent(delegate(CardData cd, int position, int total) { result.totalCards = total; result.cardsPerPage = position + 1; }); g.gatherCardMultiverseIds(0, 0, Set); return result; }