void OnComplete() { timer.Stop(); if (task.IsFaulted) { labelResult.Text = String.Format("Task failed. See log for details."); } else { labelResult.Text = String.Format("Task completed sucessfully."); buttonCancel.Text = "&Close"; this.Close(); } }