/// <summary> /// Metodo responsável por iniciar os serviços do UniNFe em threads diferentes /// </summary> public void ExecutaServicos(bool updateOptions = true) { if (servicoInstaladoErodando) { Empresas.CarregaConfiguracao(); switch (ServiceProcess.StatusService(srvName)) { case System.ServiceProcess.ServiceControllerStatus.Stopped: ServiceProcess.StartService(srvName, 40000); break; case System.ServiceProcess.ServiceControllerStatus.Paused: ServiceProcess.RestartService(srvName, 40000); break; } if (updateOptions) { this.updateControleDoServico(); } } else { ThreadService.Start(); } }
/// <summary> /// Metodo responsável por iniciar os serviços do UniNFe em threads diferentes /// </summary> private void ExecutaServicos() { Empresa.CarregaConfiguracao(); if (servicoInstaladoErodando) { if (restartServico) { ServiceProcess.StopService(srvName, 40000); } restartServico = false; switch (ServiceProcess.StatusService(srvName)) { case System.ServiceProcess.ServiceControllerStatus.Stopped: ServiceProcess.StartService(srvName, 40000); break; case System.ServiceProcess.ServiceControllerStatus.Paused: ServiceProcess.RestartService(srvName, 40000); break; } this.updateControleDoServico(); } else { ThreadService.Start(); } }