Ejemplo n.º 1
0
        /// <summary>
        /// Callback for when simulation finishes, if there is a focused element updates <see cref="_Value"/>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SimulationCompleted(object sender, SimulationCompletedEventArgs e)
        {
            var focused = IoC.Resolve <IFocusManager>().FocusedComponent;

            // If the info is not null and there is a focused element, update the info
            if (_Value != null && focused != null)
            {
                _Value.Update(focused);
            }
        }
Ejemplo n.º 2
0
 private void OnSimulationCompleted(object sender, SimulationCompletedEventArgs e)
 {
     simulation.Completed -= OnSimulationCompleted;
     simulation.SimulationParameters.Output.Error -= OnOutputError;
     AppDomain.CurrentDomain.UnhandledException   -= OnCurrentDomainUnhandledException;
     TaskScheduler.UnobservedTaskException        -= OnUnobservedTaskException;
     if (simulation.SimulationParameters.LiveOutput != null)
     {
         Settings.Default.Save();
     }
     simulation.Dispose();
     SystemUtils.SetThreadExecutionMode();
     if (e.Cancelled)
     {
         Environment.Exit(1);
     }
     Environment.Exit(0);
 }
Ejemplo n.º 3
0
 private void OnSimulationCompleted(object sender, SimulationCompletedEventArgs e)
 {
     UnsubscribeSimulationEvents();
 }