net7.0
This commit is contained in:
@ -7,9 +7,10 @@ public class Item : Properties.IItem
|
||||
{
|
||||
|
||||
protected readonly bool? _Abandoned;
|
||||
protected readonly bool? _Changed;
|
||||
protected List<Face> _Faces;
|
||||
protected readonly FileHolder? _ImageFileHolder;
|
||||
protected readonly bool? _FileSizeChanged;
|
||||
protected readonly FileHolder _ImageFileHolder;
|
||||
protected bool? _LastWriteTimeChanged;
|
||||
protected bool? _Moved;
|
||||
protected readonly bool? _NoJson;
|
||||
protected Property? _Property;
|
||||
@ -18,9 +19,10 @@ public class Item : Properties.IItem
|
||||
protected readonly string _SourceDirectoryFile;
|
||||
protected bool _ValidImageFormatExtension;
|
||||
public bool? Abandoned => _Abandoned;
|
||||
public bool? Changed => _Changed;
|
||||
public List<Face> Faces => _Faces;
|
||||
public FileHolder? ImageFileHolder => _ImageFileHolder;
|
||||
public bool? FileSizeChanged => _FileSizeChanged;
|
||||
public FileHolder ImageFileHolder => _ImageFileHolder;
|
||||
public bool? LastWriteTimeChanged => _LastWriteTimeChanged;
|
||||
public bool? Moved => _Moved;
|
||||
public bool? NoJson => _NoJson;
|
||||
public Property? Property => _Property;
|
||||
@ -30,32 +32,25 @@ public class Item : Properties.IItem
|
||||
public bool ValidImageFormatExtension => _ValidImageFormatExtension;
|
||||
|
||||
[JsonConstructor]
|
||||
public Item(bool? abandoned, bool? changed, List<Face> faces, FileHolder? imageFileHolder, bool? moved, bool? noJson, Property? property, string relativePath, FileHolder? resizedFileHolder, string sourceDirectoryFile, bool validImageFormatExtension)
|
||||
public Item(bool? abandoned, List<Face> faces, bool? fileSizeChanged, FileHolder imageFileHolder, bool? lastWriteTimeChanged, bool? moved, bool? noJson, Property? property, string relativePath, FileHolder? resizedFileHolder, string sourceDirectoryFile, bool validImageFormatExtension)
|
||||
{
|
||||
_Abandoned = abandoned;
|
||||
_Changed = changed;
|
||||
_Faces = faces;
|
||||
_ImageFileHolder = imageFileHolder;
|
||||
_Moved = moved;
|
||||
_NoJson = noJson;
|
||||
_Property = property;
|
||||
_Abandoned = abandoned;
|
||||
_RelativePath = relativePath;
|
||||
_FileSizeChanged = fileSizeChanged;
|
||||
_ImageFileHolder = imageFileHolder;
|
||||
_ResizedFileHolder = resizedFileHolder;
|
||||
_SourceDirectoryFile = sourceDirectoryFile;
|
||||
_LastWriteTimeChanged = lastWriteTimeChanged;
|
||||
_ValidImageFormatExtension = validImageFormatExtension;
|
||||
}
|
||||
|
||||
public Item(string sourceDirectoryFile, string relativePath, FileHolder imageFileInfo, bool isValidImageFormatExtension, Property? property, bool? abandoned, bool? changed)
|
||||
public Item(string sourceDirectoryFile, string relativePath, FileHolder imageFileInfo, bool validImageFormatExtension, Property? property, bool? abandoned, bool? fileSizeChanged, bool? lastWriteTimeChanged) :
|
||||
this(abandoned, new(), fileSizeChanged, imageFileInfo, lastWriteTimeChanged, null, abandoned is null, property, relativePath, null, sourceDirectoryFile, validImageFormatExtension)
|
||||
{
|
||||
_Faces = new();
|
||||
_Changed = changed;
|
||||
_Property = property;
|
||||
_Abandoned = abandoned;
|
||||
_NoJson = abandoned is null;
|
||||
_RelativePath = relativePath;
|
||||
_ImageFileHolder = imageFileInfo;
|
||||
_SourceDirectoryFile = sourceDirectoryFile;
|
||||
_ValidImageFormatExtension = isValidImageFormatExtension;
|
||||
if (relativePath.EndsWith(".json"))
|
||||
throw new ArgumentException("Can not be a *.json file!");
|
||||
if (imageFileInfo is not null && imageFileInfo.ExtensionLowered is ".json")
|
||||
@ -63,7 +58,7 @@ public class Item : Properties.IItem
|
||||
}
|
||||
|
||||
public Item(string sourceDirectoryFile, string relativePath, bool isValidImageFormatExtension) :
|
||||
this(sourceDirectoryFile, relativePath, new(sourceDirectoryFile), isValidImageFormatExtension, null, null, null)
|
||||
this(sourceDirectoryFile, relativePath, new(sourceDirectoryFile), isValidImageFormatExtension, null, null, null, null)
|
||||
{ }
|
||||
|
||||
public override string ToString()
|
||||
@ -84,7 +79,7 @@ public class Item : Properties.IItem
|
||||
_ResizedFileHolder = fileHolder;
|
||||
}
|
||||
|
||||
public bool Any() => (_Abandoned.HasValue && _Abandoned.Value) || (_Changed.HasValue && _Changed.Value) || (_Moved.HasValue && _Moved.Value) || (_NoJson.HasValue && _NoJson.Value);
|
||||
public bool Any() => (_Abandoned.HasValue && _Abandoned.Value) || (_FileSizeChanged.HasValue && _FileSizeChanged.Value) || (_LastWriteTimeChanged.HasValue && _LastWriteTimeChanged.Value) || (_Moved.HasValue && _Moved.Value) || (_NoJson.HasValue && _NoJson.Value);
|
||||
|
||||
public void Update(Property property) => _Property = property;
|
||||
|
||||
|
Reference in New Issue
Block a user