Ejemplo n.º 1
0
 /// <summary>
 /// Event Handler for Programmatic events: Stop, Pause, Resume.
 /// Use this event to clean up when a program is stopping, pausing, and resuming.
 /// This event only applies to this SIMPL#Pro program, it doesn't receive events
 /// for other programs stopping
 /// </summary>
 /// <param name="programStatusEventType"></param>
 void ControlSystem_ControllerProgramEventHandler(eProgramStatusEventType programStatusEventType)
 {
     switch (programStatusEventType)
     {
     case (eProgramStatusEventType.Stopping):
         //The program has been stopped.
         //Close all threads.
         //Shutdown all Client/Servers in the system.
         //General cleanup.
         //Unsubscribe to all System Monitor events
         server.Unregister();
         server.Dispose();
         break;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Event Handler for Programmatic events: Stop, Pause, Resume.
        /// Use this event to clean up when a program is stopping, pausing, and resuming.
        /// This event only applies to this SIMPL#Pro program, it doesn't receive events
        /// for other programs stopping
        /// </summary>
        /// <param name="programStatusEventType"></param>
        void ControlSystem_ControllerProgramEventHandler(eProgramStatusEventType programStatusEventType)
        {
            switch (programStatusEventType)
            {
            case (eProgramStatusEventType.Paused):
                //The program has been paused.  Pause all user threads/timers as needed.
                break;

            case (eProgramStatusEventType.Resumed):
                //The program has been resumed. Resume all the user threads/timers as needed.
                break;

            case (eProgramStatusEventType.Stopping):
                myServer.Dispose();
                myServer.Unregister();
                break;
            }
        }
Ejemplo n.º 3
0
 private void ProgramStatusHandler(eProgramStatusEventType status)
 {
     if (status == eProgramStatusEventType.Stopping)
     {
         if (_api != null)
         {
             _api.Unregister();
             _api.Dispose();
         }
     }
 }