Example #1
0
 protected override void OnClosing(CancelEventArgs e)
 {
     if (SimulationWorker.IsCompleted)
     {
         Simulation.Complete();
     }
     else
     {
         e.Cancel = true;
         SimulationWorker.Stop().ContinueWith(task => this.InvokeAction(Close));
     }
 }