Genealogical Data Communication but

I still am dependant on directory
This commit is contained in:
2023-07-31 09:54:55 -07:00
parent 03e2a4ecfb
commit 02445261fe
4 changed files with 649 additions and 0 deletions

View File

@ -7,6 +7,8 @@ public record AppSettings(string Company,
string DefaultNoteType,
string[] ExcludeDirectoryNames,
string[] ExcludeSchemes,
string PersonBirthdayFormat,
char[] PersonCharacters,
string WorkingDirectoryName)
{

View File

@ -11,6 +11,8 @@ public class AppSettings
public string? DefaultNoteType { get; set; }
public string[]? ExcludeDirectoryNames { get; set; }
public string[]? ExcludeSchemes { get; set; }
public string? PersonBirthdayFormat { get; set; }
public string? PersonCharacters { get; set; }
public string? WorkingDirectoryName { get; set; }
public override string ToString()
@ -30,6 +32,10 @@ public class AppSettings
throw new NullReferenceException(nameof(appSettings.ExcludeDirectoryNames));
if (appSettings?.ExcludeSchemes is null)
throw new NullReferenceException(nameof(appSettings.ExcludeSchemes));
if (appSettings?.PersonBirthdayFormat is null)
throw new NullReferenceException(nameof(appSettings.PersonBirthdayFormat));
if (appSettings?.PersonCharacters is null)
throw new NullReferenceException(nameof(appSettings.PersonCharacters));
if (appSettings?.WorkingDirectoryName is null)
throw new NullReferenceException(nameof(appSettings.WorkingDirectoryName));
result = new(
@ -37,6 +43,8 @@ public class AppSettings
appSettings.DefaultNoteType,
appSettings.ExcludeDirectoryNames,
appSettings.ExcludeSchemes,
appSettings.PersonBirthdayFormat,
appSettings.PersonCharacters.ToArray(),
appSettings.WorkingDirectoryName
);
return result;