51 lines
1.9 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace View_by_Distance.Shared.Models;
public class Property : Properties.IProperty
{
public DateTime CreationTime { init; get; }
public DateTime? DateTime { init; get; }
public DateTime? DateTimeDigitized { init; get; }
public DateTime? DateTimeFromName { init; get; }
public DateTime? DateTimeOriginal { init; get; }
public long FileSize { init; get; }
public DateTime? GPSDateStamp { init; get; }
public int? Height { init; get; }
public int? Id { init; get; }
public DateTime LastWriteTime { init; get; }
public string? Make { init; get; }
public string? Model { init; get; }
public string? Orientation { init; get; }
public int? Width { init; get; }
[JsonConstructor]
public Property(DateTime creationTime, DateTime? dateTime, DateTime? dateTimeDigitized, DateTime? dateTimeFromName, DateTime? dateTimeOriginal, long fileSize, DateTime? gpsDateStamp, int? height, int? id, DateTime lastWriteTime, string? make, string? model, string? orientation, int? width)
{
DateTimeFromName = dateTimeFromName;
CreationTime = creationTime;
DateTime = dateTime;
DateTimeDigitized = dateTimeDigitized;
DateTimeOriginal = dateTimeOriginal;
FileSize = fileSize;
GPSDateStamp = gpsDateStamp;
Height = height;
Id = id;
LastWriteTime = lastWriteTime;
Make = make;
Model = model;
Orientation = orientation;
Width = width;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
} // ...
public List<DateTime> GetDateTimes() => Stateless.Methods.Property.GetDateTimes(CreationTime, LastWriteTime, DateTime, DateTimeDigitized, DateTimeFromName, DateTimeOriginal, GPSDateStamp);
}