public InstallServiceSettingsImpl(HostSettings settings, Credentials credentials, HostStartMode startMode, string[] dependencies) { _credentials = credentials; _settings = settings; _startMode = startMode; _dependencies = dependencies; }
public InstallBuilder(HostEnvironment environment, HostSettings settings) { _preActions = new List <Action>(); _postActions = new List <Action>(); _dependencies = new List <string>(); _startMode = HostStartMode.Automatic; _credentials = new Credentials("", "", ServiceAccount.LocalSystem); _environment = environment; _settings = settings; }
public InstallHost(HostEnvironment environment, HostSettings settings, HostStartMode startMode, IEnumerable <string> dependencies, Credentials credentials, IEnumerable <Action> preActions, IEnumerable <Action> postActions, bool sudo) { _environment = environment; _settings = settings; _installSettings = new InstallServiceSettingsImpl(settings, credentials, startMode, dependencies.ToArray()); _preActions = preActions; _postActions = postActions; _sudo = sudo; }
public InstallHost(HostEnvironment environment, HostSettings settings, HostStartMode startMode, IEnumerable<string> dependencies, Credentials credentials, IEnumerable<Action> preActions, IEnumerable<Action> postActions, bool sudo) { _environment = environment; _settings = settings; _installSettings = new InstallServiceSettingsImpl(settings, credentials, startMode, dependencies.ToArray()); _preActions = preActions; _postActions = postActions; _sudo = sudo; }
private static ServiceInstaller CreateServiceInstaller(HostSettings settings, string[] dependencies, HostStartMode startMode) { var installer = new ServiceInstaller { ServiceName = settings.ServiceName, Description = settings.Description, DisplayName = settings.DisplayName, ServicesDependedOn = dependencies }; SetStartMode(installer, startMode); return installer; }
static ServiceInstaller ConfigureServiceInstaller(HostSettings settings, string[] dependencies, HostStartMode startMode) { var installer = new ServiceInstaller { ServiceName = settings.ServiceName, Description = settings.Description, DisplayName = settings.DisplayName, ServicesDependedOn = dependencies }; SetStartMode(installer, startMode); return(installer); }
static void SetStartMode(ServiceInstaller installer, HostStartMode startMode) { switch (startMode) { case HostStartMode.Automatic: installer.StartType = ServiceStartMode.Automatic; break; case HostStartMode.Manual: installer.StartType = ServiceStartMode.Manual; break; case HostStartMode.Disabled: installer.StartType = ServiceStartMode.Disabled; break; case HostStartMode.AutomaticDelayed: installer.StartType = ServiceStartMode.Automatic; installer.DelayedAutoStart = true; break; } }
public void ConfigurationIsLoadedCorrectly() { // arrange const string serviceName = "Test"; const string serviceDisplayName = "Test Display"; const string serviceDescription = "Test Description"; const HostStartMode startMode = HostStartMode.Automatic; ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.ServiceName, serviceName); ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.ServiceDisplayName, serviceDisplayName); ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.ServiceDescription, serviceDescription); ApplicationConfigurationHelper.AdjustKeys(ConfigurationKeys.ServiceStartMode, startMode.ToString()); // act var sut = new TopShelfConfiguration(); // assert sut.Name.Should().Be(serviceName); sut.DisplayName.Should().Be(serviceDisplayName); sut.Description.Should().Be(serviceDescription); sut.StartMode.Should().Be(startMode); }
public StartModeHostConfigurator(HostStartMode startMode) { _startMode = startMode; }
private static void SetStartMode(ServiceInstaller installer, HostStartMode startMode) { switch (startMode) { case HostStartMode.Automatic: installer.StartType = ServiceStartMode.Automatic; break; case HostStartMode.Manual: installer.StartType = ServiceStartMode.Manual; break; case HostStartMode.Disabled: installer.StartType = ServiceStartMode.Disabled; break; case HostStartMode.AutomaticDelayed: installer.StartType = ServiceStartMode.Automatic; installer.DelayedAutoStart = true; break; } }
public void SetStartMode(HostStartMode startMode) { _startMode = startMode; }
public StartModeHostConfigurator(HostStartMode startMode) { StartMode = startMode; }