private void SummonButton_Click(object sender, EventArgs e) { var t = new Thread(() => { Func <int, int> iteration = i => { summonButton.Text = (i + 1).ToString() + "..."; return(1); }; summonButton.Enabled = false; var unit = Unit.Units.First(u => u.Name == unitDataGrid.Rows[unitDataGrid.CurrentRow.Index].Cells[0].Value.ToString() && u.UnitId == u.BaseUnitId); var b = new BraveExvius { FacebookUserId = fbidInput.Text.Replace(" ", ""), FacebookToken = fbtokenInput.Text.Replace(" ", "") }; b.Login(); b.UnitHunter(unit, iteration); summonButton.Text = "summon highlighted"; summonButton.Enabled = true; }); t.IsBackground = true; t.Start(); }
private void SummonButton_Click(object sender, EventArgs e) { var t = new Thread(() => { Func <int, int> iteration = i => { summonButton.Text = (i + 1).ToString() + "..."; return(1); }; summonButton.Enabled = false; var unit = unitSelect.SelectedItem as Unit; client.Login(); client.UnitHunter(unit, iteration); summonButton.Text = "summon"; summonButton.Enabled = true; }); t.IsBackground = true; t.Start(); }