a
This commit is contained in:
@ -14,10 +14,12 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
||||
public string FileNameDirectorySeparator { init; get; }
|
||||
public bool ForcePropertyLastWriteTimeToCreationTime { init; get; }
|
||||
public string[] IgnoreExtensions { init; get; }
|
||||
public string[] IgnoreRulesKeyWords { init; get; }
|
||||
public int MaxImagesInDirectoryForTopLevelFirstPass { init; get; }
|
||||
public string? ModelName { init; get; }
|
||||
public int? NumberOfJitters { init; get; }
|
||||
public int? NumberOfTimesToUpsample { init; get; }
|
||||
public int Offset { init; get; }
|
||||
public string Pattern { init; get; }
|
||||
public string PersonBirthdayFormat { init; get; }
|
||||
public bool PopulatePropertyId { init; get; }
|
||||
@ -36,10 +38,12 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
||||
string fileNameDirectorySeparator,
|
||||
bool forcePropertyLastWriteTimeToCreationTime,
|
||||
string[] ignoreExtensions,
|
||||
string[] ignoreRulesKeyWords,
|
||||
int maxImagesInDirectoryForTopLevelFirstPass,
|
||||
string? modelName,
|
||||
int? numberOfJitters,
|
||||
int? numberOfTimesToUpsample,
|
||||
int offset,
|
||||
string pattern,
|
||||
string personBirthdayFormat,
|
||||
bool populatePropertyId,
|
||||
@ -59,10 +63,12 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
||||
FileNameDirectorySeparator = fileNameDirectorySeparator;
|
||||
ForcePropertyLastWriteTimeToCreationTime = forcePropertyLastWriteTimeToCreationTime;
|
||||
IgnoreExtensions = ignoreExtensions;
|
||||
IgnoreRulesKeyWords = ignoreRulesKeyWords;
|
||||
MaxImagesInDirectoryForTopLevelFirstPass = maxImagesInDirectoryForTopLevelFirstPass;
|
||||
ModelName = modelName;
|
||||
NumberOfJitters = numberOfJitters;
|
||||
NumberOfTimesToUpsample = numberOfTimesToUpsample;
|
||||
Offset = offset;
|
||||
Pattern = pattern;
|
||||
PersonBirthdayFormat = personBirthdayFormat;
|
||||
PredictorModelName = predictorModelName;
|
||||
@ -89,26 +95,17 @@ public class Configuration : Shared.Models.Properties.IPropertyConfiguration
|
||||
|
||||
public static void Verify(Configuration propertyConfiguration, bool requireExist)
|
||||
{
|
||||
if (propertyConfiguration is null)
|
||||
throw new NullReferenceException(nameof(propertyConfiguration));
|
||||
if (propertyConfiguration.IgnoreExtensions is null || propertyConfiguration.IgnoreExtensions.Length == 0)
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.IgnoreExtensions));
|
||||
if (propertyConfiguration.PropertyContentCollectionFiles is null)
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
|
||||
if (propertyConfiguration.ValidImageFormatExtensions is null || propertyConfiguration.ValidImageFormatExtensions.Length == 0)
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.ValidImageFormatExtensions));
|
||||
if (propertyConfiguration is null)
|
||||
throw new NullReferenceException(nameof(propertyConfiguration));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.DateGroup))
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.DateGroup));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.FileNameDirectorySeparator))
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.FileNameDirectorySeparator));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.Pattern))
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.Pattern));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.RootDirectory) || (requireExist && !Directory.Exists(propertyConfiguration.RootDirectory)))
|
||||
throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
|
||||
if (propertyConfiguration.RootDirectory != Path.GetFullPath(propertyConfiguration.RootDirectory))
|
||||
throw new Exception();
|
||||
if (propertyConfiguration is null) throw new NullReferenceException(nameof(propertyConfiguration));
|
||||
if (propertyConfiguration.IgnoreExtensions is null || propertyConfiguration.IgnoreExtensions.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.IgnoreExtensions));
|
||||
if (propertyConfiguration.IgnoreRulesKeyWords is null || propertyConfiguration.IgnoreRulesKeyWords.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.IgnoreRulesKeyWords));
|
||||
if (propertyConfiguration.PropertyContentCollectionFiles is null) throw new NullReferenceException(nameof(propertyConfiguration.PropertyContentCollectionFiles));
|
||||
if (propertyConfiguration.ValidImageFormatExtensions is null || propertyConfiguration.ValidImageFormatExtensions.Length == 0) throw new NullReferenceException(nameof(propertyConfiguration.ValidImageFormatExtensions));
|
||||
if (propertyConfiguration is null) throw new NullReferenceException(nameof(propertyConfiguration));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.DateGroup)) throw new NullReferenceException(nameof(propertyConfiguration.DateGroup));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.FileNameDirectorySeparator)) throw new NullReferenceException(nameof(propertyConfiguration.FileNameDirectorySeparator));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.Pattern)) throw new NullReferenceException(nameof(propertyConfiguration.Pattern));
|
||||
if (string.IsNullOrEmpty(propertyConfiguration.RootDirectory) || (requireExist && !Directory.Exists(propertyConfiguration.RootDirectory))) throw new NullReferenceException(nameof(propertyConfiguration.RootDirectory));
|
||||
if (propertyConfiguration.RootDirectory != Path.GetFullPath(propertyConfiguration.RootDirectory)) throw new Exception();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user