Example #1
0
 public void Executive_can_be_started_and_stopped()
 {
     executive.Start().Wait();
     Assert.AreEqual(State.Running, executive.State);
     executive.Stop().Wait();
     Assert.AreEqual(State.Stopped, executive.State);
 }
Example #2
0
 /// <summary>
 /// Aborts the model.
 /// </summary>
 public virtual void Abort()
 {
     if (s_diagnostics)
     {
         _Debug.WriteLine("Model.Abort() requested.");
     }
     Exec.Stop();
     m_stateMachine.DoTransition(GetAbortEnum());
     if (!IsReady)
     {
         IsRunning   = false;
         IsReady     = false;
         IsPaused    = false;
         IsCompleted = true;
     }
 }
Example #3
0
        private void StopAndRestartExec(object obj)
        {
            System.Threading.Thread.Sleep(1000);
            IExecutive exec = (IExecutive)obj;

            Debug.WriteLine("\r\n" + "Pausing for two seconds..." + "\r\n");
            Debug.WriteLine("Before pause, Exec state is " + exec.State);
            exec.Stop();
            System.Threading.Thread.Sleep(2000);
            Debug.WriteLine("After pause, Exec state is " + exec.State);
            Debug.WriteLine("\r\n" + "Resuming..." + "\r\n");
            exec.Start();
            Debug.WriteLine("Exec state is now " + exec.State);
        }
Example #4
0
 public void Stop()
 {
     executive.Stop().Wait();
 }