Throw for necessary settings

pull/356/head
NextTurn 2018-12-05 00:00:00 +08:00
parent 5be8708701
commit 315b0ac440
No known key found for this signature in database
GPG Key ID: 17A0D50ADDE1A0C4
1 changed files with 7 additions and 7 deletions

View File

@ -13,10 +13,10 @@ namespace winsw.Configuration
/// </summary> /// </summary>
public sealed class DefaultWinSWSettings : IWinSWConfiguration public sealed class DefaultWinSWSettings : IWinSWConfiguration
{ {
public string Id => null; public string Id => throw new InvalidOperationException(nameof(Id) + " must be specified.");
public string Caption => null; public string Caption => throw new InvalidOperationException(nameof(Caption) + " must be specified.");
public string Description => null; public string Description => throw new InvalidOperationException(nameof(Description) + " must be specified.");
public string Executable => null; public string Executable => throw new InvalidOperationException(nameof(Executable) + " must be specified.");
public bool HideWindow => false; public bool HideWindow => false;
// this returns the executable name as given by the calling process, so // this returns the executable name as given by the calling process, so
@ -27,7 +27,7 @@ namespace winsw.Configuration
public bool AllowServiceAcountLogonRight => false; public bool AllowServiceAcountLogonRight => false;
public string? ServiceAccountPassword => null; public string? ServiceAccountPassword => null;
public string ServiceAccountUser => "NULL\\NULL"; public string ServiceAccountUser => "NULL\\NULL";
public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>(); public List<Native.SC_ACTION> FailureActions => new List<Native.SC_ACTION>(0);
public TimeSpan ResetFailureAfter => TimeSpan.FromDays(1); public TimeSpan ResetFailureAfter => TimeSpan.FromDays(1);
// Executable management // Executable management
@ -58,8 +58,8 @@ namespace winsw.Configuration
public string ErrFilePattern => ".err.log"; public string ErrFilePattern => ".err.log";
// Environment // Environment
public List<Download> Downloads => new List<Download>(); public List<Download> Downloads => new List<Download>(0);
public Dictionary<string, string> EnvironmentVariables => new Dictionary<string, string>(); public Dictionary<string, string> EnvironmentVariables => new Dictionary<string, string>(0);
// Misc // Misc
public bool BeepOnShutdown => false; public bool BeepOnShutdown => false;