public TaskForm(Task task, CancellationTokenSource cancellationTokenSource)
{
InitializeComponent();
this.task = task;
stopwatch = Stopwatch.StartNew();
timer.Start();
task.ContinueWith((t, o) => OnComplete(), null, TaskScheduler.FromCurrentSynchronizationContext());
this.cancellationTokenSource = cancellationTokenSource;
this.FormClosing += TaskForm_FormClosing;
}