Beispiel #1
0
 private static void ValidateServicesRunning(object sender, ElapsedEventArgs e)
 {
     foreach (string serviceName in services)
     {
         using (ServiceController sc = new ServiceController(serviceName))
         {
             if (sc.Status != ServiceControllerStatus.Running)
             {
                 ServiceStopped?.Invoke(null, serviceName);
             }
         }
     }
 }
Beispiel #2
0
 protected virtual void OnServiceStopped(FileSystemEventArgs e)
 {
     ServiceStopped?.Invoke(this, null);
 }