Ejemplo n.º 1
0
        void ServiceController_OnChangeServiceState(object sender, EventArgs e)
        {
            switch (((ServiceController)sender).ServiceState)
            {
            case ServiceController.EnumServiceState.Paused:
                SchedulingService.Pause();
                break;

            case ServiceController.EnumServiceState.Stopped:
                SchedulingService.Stop();
                break;

            case ServiceController.EnumServiceState.Started:
                SchedulingService.Resume();
                break;
            }
        }