From 77f800d1a49fdbfa1e1d34824f2bb53116fc53e6 Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Tue, 8 Aug 2023 19:09:17 -0700 Subject: [PATCH] PropertyGenerationContext --- Face/Models/_D_Face.cs | 6 +++--- Resize/Models/_C_Resize.cs | 2 +- Shared/Models/Property.cs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Face/Models/_D_Face.cs b/Face/Models/_D_Face.cs index 1a34446..f5635da 100644 --- a/Face/Models/_D_Face.cs +++ b/Face/Models/_D_Face.cs @@ -191,11 +191,11 @@ public class D_Face { using (graphics = Graphics.FromImage(bitmap)) graphics.DrawImage(source, new Rectangle(0, 0, width, height), rectangle, GraphicsUnit.Pixel); - propertyItem = Property.Models.Stateless.IProperty.GetPropertyItem(_ConstructorInfo, fileSource, type, locationJson); + propertyItem = IProperty.GetPropertyItem(_ConstructorInfo, fileSource, type, locationJson); bitmap.SetPropertyItem(propertyItem); - propertyItem = Property.Models.Stateless.IProperty.GetPropertyItem(_ConstructorInfo, artist, type, outputResolutionJson); + propertyItem = IProperty.GetPropertyItem(_ConstructorInfo, artist, type, outputResolutionJson); bitmap.SetPropertyItem(propertyItem); - propertyItem = Property.Models.Stateless.IProperty.GetPropertyItem(_ConstructorInfo, userComment, type, faceEncodingJson); + propertyItem = IProperty.GetPropertyItem(_ConstructorInfo, userComment, type, faceEncodingJson); bitmap.SetPropertyItem(propertyItem); bitmap.Save(fileInfo.FullName, _ImageCodecInfo, _EncoderParameters); } diff --git a/Resize/Models/_C_Resize.cs b/Resize/Models/_C_Resize.cs index 5741eb8..d494a81 100644 --- a/Resize/Models/_C_Resize.cs +++ b/Resize/Models/_C_Resize.cs @@ -294,7 +294,7 @@ public class C_Resize private void SaveResizedSubfile(Shared.Models.Property property, MappingFromItem mappingFromItem, int[] resize) { - string dateTimeFormat = Property.Models.Stateless.IProperty.DateTimeFormat(); + string dateTimeFormat = IProperty.DateTimeFormat(); DateTime dateTime = property.DateTimeOriginal is not null ? property.DateTimeOriginal.Value : Shared.Models.Stateless.Methods.IProperty.GetMinimumDateTime(property); string dateTimeValue = dateTime.ToString(dateTimeFormat); byte[] bytes = _ASCIIEncoding.GetBytes(dateTimeValue); diff --git a/Shared/Models/Property.cs b/Shared/Models/Property.cs index e5a5c65..c827227 100644 --- a/Shared/Models/Property.cs +++ b/Shared/Models/Property.cs @@ -22,16 +22,16 @@ public record Property(DateTime CreationTime, public override string ToString() { - string result = JsonSerializer.Serialize(this, AppSettingsSourceGenerationContext.Default.Property); + string result = JsonSerializer.Serialize(this, PropertyGenerationContext.Default.Property); return result; } - + public List GetDateTimes() => Stateless.Methods.Property.GetDateTimes(CreationTime, LastWriteTime, DateTime, DateTimeDigitized, DateTimeFromName, DateTimeOriginal, GPSDateStamp); } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Property))] -internal partial class AppSettingsSourceGenerationContext : JsonSerializerContext +internal partial class PropertyGenerationContext : JsonSerializerContext { } \ No newline at end of file