Trigger other tasks after task is complete or had exception
The following example shows how to start a task in a separate thread. Then, using the 'ContinueWith()' function, fire another task depending on if the first task had an unhandled exception or if the task completed without any unhandled exceptions.
[[[code lang=c#|private void button1_Click(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine("button clicked");
System.Threading.Tasks.Task