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); } } } }
protected virtual void OnServiceStopped(FileSystemEventArgs e) { ServiceStopped?.Invoke(this, null); }