Delete-By-Distinct appSettings changes

This commit is contained in:
2023-06-10 17:13:33 -07:00
parent cb891b4fcf
commit bdd2a637ec
6 changed files with 90 additions and 77 deletions

View File

@ -13,7 +13,10 @@ public class AppSettings
public int? MaxDegreeOfParallelism { get; set; }
public string OutputExtension { get; set; }
public bool? RecycleOption { get; set; }
public bool? RenameToMatch { get; set; }
public string SearchPattern { get; set; }
public bool? SizeForLong { get; set; }
public bool? TicksForLong { get; set; }
public string WorkingDirectoryName { get; set; }
#nullable restore
@ -31,13 +34,24 @@ public class AppSettings
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
if (appSettings?.RecycleOption is null)
throw new NullReferenceException(nameof(appSettings.RecycleOption));
if (appSettings?.RenameToMatch is null)
throw new NullReferenceException(nameof(appSettings.RenameToMatch));
if (appSettings?.SizeForLong is null)
throw new NullReferenceException(nameof(appSettings.SizeForLong));
if (appSettings?.TicksForLong is null)
throw new NullReferenceException(nameof(appSettings.TicksForLong));
if (appSettings.TicksForLong.Value == appSettings.SizeForLong.Value)
throw new Exception("Check appSettings file!");
result = new(
appSettings.Company,
appSettings.CompareRootDirectory,
appSettings.MaxDegreeOfParallelism.Value,
appSettings.OutputExtension,
appSettings.RecycleOption.Value,
appSettings.RenameToMatch.Value,
appSettings.SearchPattern,
appSettings.SizeForLong.Value,
appSettings.TicksForLong.Value,
appSettings.WorkingDirectoryName
);
return result;