private void SetServiceStatus(string serviceName)
        {
            var serviceModel = _model.Services.Single(x => x.ServiceName == serviceName);

            serviceModel.ServiceExists = _windowsServiceHelper.ServiceExists(serviceName);
            if (serviceModel.ServiceExists)
            {
                serviceModel.DisplayName      = _windowsServiceHelper.GetServiceDisplayName(serviceName);
                serviceModel.IsServiceEnabled = _windowsServiceHelper.IsServiceEnabled(serviceName);
            }
        }
Beispiel #2
0
        private void SetServiceStatus(string serviceName)
        {
            var serviceModel = _model.Services.Single(x => x.ServiceName == serviceName);

            try
            {
                serviceModel.ServiceExists = _windowsServiceHelper.ServiceExists(serviceName);
                if (serviceModel.ServiceExists)
                {
                    serviceModel.DisplayName      = _windowsServiceHelper.GetServiceDisplayName(serviceName);
                    serviceModel.IsServiceEnabled = _windowsServiceHelper.IsServiceEnabled(serviceName);
                }
            }
            catch (Exception ex)
            {
                Wu10Logger.LogError(ex);
            }
        }