Save-Image-Info
This commit is contained in:
@ -6,14 +6,12 @@ namespace View_by_Distance.Copy.Distinct.Models.Binder;
|
||||
public class AppSettings
|
||||
{
|
||||
|
||||
#nullable disable
|
||||
|
||||
public string Company { get; set; }
|
||||
public string? Company { get; set; }
|
||||
public int? MaxDegreeOfParallelism { get; set; }
|
||||
public string CopyTo { get; set; }
|
||||
public string WorkingDirectoryName { get; set; }
|
||||
|
||||
#nullable restore
|
||||
public bool? CopyDuplicates { get; set; }
|
||||
public string? CopyTo { get; set; }
|
||||
public string? ResultDirectoryKey { init; get; }
|
||||
public string? WorkingDirectoryName { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
@ -24,12 +22,24 @@ public class AppSettings
|
||||
private static Models.AppSettings Get(AppSettings? appSettings)
|
||||
{
|
||||
Models.AppSettings result;
|
||||
if (appSettings?.Company is null)
|
||||
throw new NullReferenceException(nameof(appSettings.Company));
|
||||
if (appSettings?.CopyDuplicates is null)
|
||||
throw new NullReferenceException(nameof(appSettings.CopyDuplicates));
|
||||
if (appSettings?.CopyTo is null)
|
||||
throw new NullReferenceException(nameof(appSettings.CopyTo));
|
||||
if (appSettings?.MaxDegreeOfParallelism is null)
|
||||
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
|
||||
if (appSettings?.ResultDirectoryKey is null)
|
||||
throw new NullReferenceException(nameof(appSettings.ResultDirectoryKey));
|
||||
if (appSettings?.WorkingDirectoryName is null)
|
||||
throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
|
||||
result = new(
|
||||
appSettings.Company,
|
||||
appSettings.CopyDuplicates.Value,
|
||||
appSettings.CopyTo,
|
||||
appSettings.MaxDegreeOfParallelism.Value,
|
||||
appSettings.ResultDirectoryKey,
|
||||
appSettings.WorkingDirectoryName
|
||||
);
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user