Пример #1
0
 /// <summary>
 /// This is the event handler for the ConsoleCancelEventArgs event type, it is used to terminate the program.
 /// </summary>
 /// <param name="sender">Object value passed as the object which has triggered the event.</param>
 /// <param name="e">The event information that sent from the event handler.</param>
 static void OnCancelKeyPress(object sender, ConsoleCancelEventArgs e)
 {
     lock (m_lock)
     {
         m_reset.Set();
         log.Info("Terminating program...");
         m_resources.Dispose();
         m_server.Dispose();
         log.Info("Program terminated...");
     }
 }