What I am trying to do is if a certain condition is met, stop the service.
I can stop a service by
ServiceController sc = new ServiceController("serviceName");
sc.Stop();
Is there a way to stop the current service without passing in the service name?
There is a constructor without parameters.
That should give you a service controller instance that is in the context of the currently running windows service.