private async void button2_Click(object sender, EventArgs e)
{
label1.Text = "Running Task";
button2.Enabled = false;
string result = await WaitAsynchronouslyAsync();
label1.Text = result;
button2.Enabled = true;
}
public async Task<string> WaitAsynchronouslyAsync()
{
await Task.Delay(10000);
return "Finished";
}
await Task.Run(() => UpdateCheck());
private void UpdateCheck()
{
...
}