53 lines
2.0 KiB
C#
53 lines
2.0 KiB
C#
using System.Text.Json;
|
|
|
|
namespace View_by_Distance.PropertyCompare.Models;
|
|
|
|
public partial class PropertyCompare
|
|
{
|
|
|
|
protected string _Extension;
|
|
protected string _FileNameWithoutExtension;
|
|
protected readonly bool _IsArg;
|
|
protected DateTime _MinimumDateTime;
|
|
protected readonly List<long> _Numbers;
|
|
protected Shared.Models.Property? _Property;
|
|
protected string _RegexResult;
|
|
protected string _RelativeDirectory;
|
|
protected readonly List<string> _Strings;
|
|
|
|
public string Extension => _Extension;
|
|
public string FileNameWithoutExtension => _FileNameWithoutExtension;
|
|
public bool IsArg => _IsArg;
|
|
public DateTime MinimumDateTime => _MinimumDateTime;
|
|
public List<long> Numbers => _Numbers;
|
|
public Shared.Models.Property? Property => _Property;
|
|
public string RegexResult => _RegexResult;
|
|
public string RelativeDirectory => _RelativeDirectory;
|
|
public List<string> Strings => _Strings;
|
|
|
|
public PropertyCompare(string extension, string fileNameWithoutExtension, bool isArg, DateTime minimumDateTime, List<long> numbers, Shared.Models.Property property, string regexResult, string relativeDirectory, List<string> strings)
|
|
{
|
|
_IsArg = isArg;
|
|
_Numbers = numbers;
|
|
_Strings = strings;
|
|
_Property = property;
|
|
_Extension = extension;
|
|
_RegexResult = regexResult;
|
|
_MinimumDateTime = minimumDateTime;
|
|
_RelativeDirectory = relativeDirectory;
|
|
_FileNameWithoutExtension = fileNameWithoutExtension;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
|
return result;
|
|
}
|
|
|
|
#nullable disable
|
|
|
|
public string GetSelect() => string.Concat(_RelativeDirectory, _FileNameWithoutExtension, _Extension, '\t', _Property.CreationTime.Ticks, '\t', Shared.Models.Stateless.Methods.IProperty.GetDateTime(_Property).ToString("yyyy-MM-dd_HH-mm-ss"), '\t', _Property.Id, '\t', _Property.FileSize, '\t', _Property.Width, '\t', _Property.Height);
|
|
|
|
#nullable restore
|
|
|
|
} |