bool ServiceHandle.Start(HostControl hostControl) { _hostControl = hostControl; var control = new AppDomainHostControl(this); return(_service.Start(control)); }
void RestartService(object state) { try { _log.InfoFormat("Restarting service: {0}", _settings.ServiceName); var control = new AppDomainHostControl(this); _service.Stop(control); UnloadServiceAppDomain(); _log.DebugFormat("Service AppDomain unloaded: {0}", _settings.ServiceName); _service = CreateServiceInAppDomain(); _log.DebugFormat("Service created in new AppDomain: {0}", _settings.ServiceName); _service.Start(control); _log.InfoFormat("The service has been restarted: {0}", _settings.ServiceName); } catch (Exception ex) { _log.Error("Failed to restart service", ex); _hostControl.Stop(); } }
bool ServiceHandle.Stop(HostControl hostControl) { var control = new AppDomainHostControl(this); return(_service.Stop(control)); }
public void CustomCommand(HostControl hostControl, int command) { var control = new AppDomainHostControl(this); _service.CustomCommand(control, command); }
public void SessionChanged(HostControl hostControl, SessionChangedArguments arguments) { var control = new AppDomainHostControl(this); _service.SessionChanged(control, arguments); }
public void Shutdown(HostControl hostControl) { var control = new AppDomainHostControl(this); _service.Shutdown(control); }