示例#1
0
        private void ServiceHelper_ServiceStopping(object sender, EventArgs e)
        {
            if (!m_disposed)
            {
                try
                {
                    m_webAppHost?.Dispose();
                }
                finally
                {
                    m_disposed = true; // Prevent duplicate dispose.
                    base.Dispose();    // Call base class Dispose().
                }
            }

            // If the start engine thread is still
            // running, wait for it to stop
            m_serviceStopping = true;
            m_startEngineThread.Join();

            // Dispose of adapter loader for service monitors
            m_serviceMonitors.AdapterLoaded   -= ServiceMonitors_AdapterLoaded;
            m_serviceMonitors.AdapterUnloaded -= ServiceMonitors_AdapterUnloaded;
            m_serviceMonitors.Dispose();

            // Dispose of the analysis engine
            m_extensibleDisturbanceAnalysisEngine.Stop();
            m_extensibleDisturbanceAnalysisEngine.Dispose();

            // Save updated settings to the configuration file
            ConfigurationFile.Current.Save();
        }
示例#2
0
        private void ServiceHelper_ServiceStopping(object sender, EventArgs e)
        {
            // If the start engine thread is still
            // running, wait for it to stop
            m_serviceStopping = true;
            m_startEngineThread.Join();

            // Dispose of adapter loader for service monitors
            m_serviceMonitors.AdapterLoaded   -= ServiceMonitors_AdapterLoaded;
            m_serviceMonitors.AdapterUnloaded -= ServiceMonitors_AdapterUnloaded;
            m_serviceMonitors.Dispose();

            // Dispose of the analysis engine
            m_extensibleDisturbanceAnalysisEngine.Stop();
            m_extensibleDisturbanceAnalysisEngine.Dispose();
        }