Esempio n. 1
0
        private void buttonStop_Click(object sender, RoutedEventArgs e)
        {
            TheManager.Cleanup();

            buttonRun.IsEnabled      = true;
            buttonStop.IsEnabled     = false;
            buttonFetchNow.IsEnabled = false;

            (tabControl.Items[1] as TabItem).IsEnabled = true;
        }
        protected override void OnStop()
        {
            System.Console.WriteLine("stopping...");

            if (Manager != null)
            {
#if !MONO
                Status.dwCurrentState = ServiceState.SERVICE_PAUSE_PENDING;
                SetServiceStatus(this.ServiceHandle, ref Status);
#endif
                Manager.Cleanup();

#if !MONO
                Status.dwCurrentState = ServiceState.SERVICE_PAUSED;
                SetServiceStatus(this.ServiceHandle, ref Status);
#endif

                Manager = null;
            }
        }
        protected override void OnStop()
        {
            System.Console.WriteLine("stopping...");

            if (Manager != null)
            {
                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_PAUSE_PENDING;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }

                Manager.Cleanup();

                if (!Platform.IsRunningOnMono())
                {
                    Status.dwCurrentState = ServiceState.SERVICE_PAUSED;
                    SetServiceStatus(this.ServiceHandle, ref Status);
                }

                Manager = null;
            }
        }