Rename: ForceIdName

DeleteEmptyDirectories: UnauthorizedAccessException
This commit is contained in:
2023-07-04 13:05:54 -07:00
parent 79f069445e
commit 0bce2bf22b
5 changed files with 84 additions and 332 deletions

View File

@ -6,16 +6,12 @@ namespace View_by_Distance.Rename.Models.Binder;
public class AppSettings
{
#nullable disable
public string Company { get; set; }
public string ComparePathsFile { get; set; }
public string? Company { get; set; }
public bool? ForceIdName { get; set; }
public int? MaxDegreeOfParallelism { get; set; }
public int? MaxMinutesDelta { get; set; }
public bool? RenameUndo { get; set; }
public string WorkingDirectoryName { get; set; }
#nullable restore
public string? WorkingDirectoryName { get; set; }
public override string ToString()
{
@ -26,15 +22,21 @@ 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?.ForceIdName is null)
throw new NullReferenceException(nameof(appSettings.ForceIdName));
if (appSettings?.MaxDegreeOfParallelism is null)
throw new NullReferenceException(nameof(appSettings.MaxDegreeOfParallelism));
if (appSettings?.MaxMinutesDelta is null)
throw new NullReferenceException(nameof(appSettings.MaxMinutesDelta));
if (appSettings?.RenameUndo is null)
throw new NullReferenceException(nameof(appSettings.RenameUndo));
if (appSettings?.WorkingDirectoryName is null)
throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
result = new(
appSettings.Company,
appSettings.ComparePathsFile,
appSettings.ForceIdName.Value,
appSettings.MaxDegreeOfParallelism.Value,
appSettings.MaxMinutesDelta.Value,
appSettings.RenameUndo.Value,