diff --git a/.vscode/tasks.json b/.vscode/tasks.json index b30df40..5db8fad 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -132,6 +132,11 @@ "type": "shell", "command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe", "args": [ + "s", + "X", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG", + "Day-Helper-2024-01-08", + "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG/Adaptation/FileHandlers/Kanban", "s", "X", "T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG", diff --git a/ADO2024/PI1/Helper-2024-01-06.cs b/ADO2024/PI1/Helper-2024-01-06.cs index 779ef11..69511ff 100644 --- a/ADO2024/PI1/Helper-2024-01-06.cs +++ b/ADO2024/PI1/Helper-2024-01-06.cs @@ -1,4 +1,3 @@ -using File_Folder_Helper.Models; using Microsoft.Extensions.Logging; using System.Collections.ObjectModel; using System.Text; @@ -10,6 +9,29 @@ namespace File_Folder_Helper.ADO2024.PI1; internal static partial class Helper20240106 { + private record Host([property: JsonPropertyName("a")] string? Id, + [property: JsonPropertyName("b")] string? Colon, + [property: JsonPropertyName("c")] string? Hyphen, + [property: JsonPropertyName("d")] string? Line, + [property: JsonPropertyName("e")] string? Count, + [property: JsonPropertyName("f")] string? Segments, + [property: JsonPropertyName("g")] string? Type, + [property: JsonPropertyName("h")] string? Device, + [property: JsonPropertyName("i")] string? Name, + [property: JsonPropertyName("j")] string? Location); + + [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] + [JsonSerializable(typeof(Host[]))] + private partial class HostCollectionSourceGenerationContext : JsonSerializerContext + { + } + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(Dictionary>))] + private partial class DictionaryDictionarySourceGenerationContext : JsonSerializerContext + { + } + private record Record(string Key, Dictionary KeyValuePairs); private static Dictionary> GetKeyValuePairs(List collection, bool replaceFound) @@ -33,7 +55,7 @@ internal static partial class Helper20240106 Dictionary results = []; int id; string json = $"[{File.ReadAllText(jsonl).Replace("\r\n", ",")}]"; - Host[] hosts = JsonSerializer.Deserialize(json, HostSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(nameof(json)); + Host[] hosts = JsonSerializer.Deserialize(json, HostCollectionSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(nameof(json)); foreach (Host host in hosts) { if (host.Id is null) @@ -182,12 +204,6 @@ internal static partial class Helper20240106 File.AppendAllLines(hostConfFile, lines); } - [JsonSourceGenerationOptions(WriteIndented = true)] - [JsonSerializable(typeof(Dictionary>))] - private partial class DictionaryDictionarySourceGenerationContext : JsonSerializerContext - { - } - internal static void TextToJson(ILogger logger, List args) { string json; diff --git a/ADO2024/PI1/Helper-2024-04-09.cs b/ADO2024/PI1/Helper-2024-04-09.cs index be1ce58..b85c429 100644 --- a/ADO2024/PI1/Helper-2024-04-09.cs +++ b/ADO2024/PI1/Helper-2024-04-09.cs @@ -7,7 +7,7 @@ namespace File_Folder_Helper.ADO2024.PI1; internal static partial class Helper20240409 { - internal record FsSize( // cSpell:disable + private record FsSize( // cSpell:disable [property: JsonPropertyName("name")] string Name, [property: JsonPropertyName("object")] string Object, [property: JsonPropertyName("pmon")] string PMon, @@ -19,7 +19,7 @@ internal static partial class Helper20240409 [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] [JsonSerializable(typeof(FsSize))] - internal partial class FsSizeSourceGenerationContext : JsonSerializerContext + private partial class FsSizeSourceGenerationContext : JsonSerializerContext { } diff --git a/ADO2024/PI1/Helper-2024-04-27.cs b/ADO2024/PI1/Helper-2024-04-27.cs index 11849d0..c16a220 100644 --- a/ADO2024/PI1/Helper-2024-04-27.cs +++ b/ADO2024/PI1/Helper-2024-04-27.cs @@ -9,7 +9,7 @@ namespace File_Folder_Helper.ADO2024.PI1; internal static partial class Helper20240427 { - internal record Asset( // cSpell:disable + private record Asset( // cSpell:disable [property: JsonPropertyName("id")] string? Id, [property: JsonPropertyName("deviceAssetId")] string? DeviceAssetId, [property: JsonPropertyName("ownerId")] string? OwnerId, @@ -42,7 +42,7 @@ internal static partial class Helper20240427 [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] [JsonSerializable(typeof(List))] - internal partial class AssetCollectionSourceGenerationContext : JsonSerializerContext + private partial class AssetCollectionSourceGenerationContext : JsonSerializerContext { } diff --git a/ADO2024/PI2/Helper-2024-05-17.cs b/ADO2024/PI2/Helper-2024-05-17.cs index 31f7234..9d4c62f 100644 --- a/ADO2024/PI2/Helper-2024-05-17.cs +++ b/ADO2024/PI2/Helper-2024-05-17.cs @@ -8,26 +8,26 @@ namespace File_Folder_Helper.ADO2024.PI2; internal static partial class Helper20240517 { - public record ContentSignature([property: JsonPropertyName("contentSignature")] string Value, + private record ContentSignature([property: JsonPropertyName("contentSignature")] string Value, [property: JsonPropertyName("contentSignatureType")] string ContentSignatureType); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ContentSignature))] - public partial class ContentSignatureGenerationContext : JsonSerializerContext + private partial class ContentSignatureGenerationContext : JsonSerializerContext { } - public record Type([property: JsonPropertyName("count")] int Count, + private record Type([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Type))] - public partial class TypeGenerationContext : JsonSerializerContext + private partial class TypeGenerationContext : JsonSerializerContext { } - public record ImageAmazon([property: JsonPropertyName("colorSpace")] string ColorSpace, + private record ImageAmazon([property: JsonPropertyName("colorSpace")] string ColorSpace, [property: JsonPropertyName("dateTime")] DateTime DateTime, [property: JsonPropertyName("dateTimeDigitized")] DateTime DateTimeDigitized, [property: JsonPropertyName("dateTimeOriginal")] DateTime DateTimeOriginal, @@ -54,11 +54,11 @@ internal static partial class Helper20240517 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ImageAmazon))] - public partial class ImageAmazonGenerationContext : JsonSerializerContext + private partial class ImageAmazonGenerationContext : JsonSerializerContext { } - public record ContentProperties([property: JsonPropertyName("contentDate")] DateTime ContentDate, + private record ContentProperties([property: JsonPropertyName("contentDate")] DateTime ContentDate, [property: JsonPropertyName("contentSignatures")] IReadOnlyList ContentSignatures, [property: JsonPropertyName("contentType")] string ContentType, [property: JsonPropertyName("extension")] string Extension, @@ -69,19 +69,19 @@ internal static partial class Helper20240517 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ContentProperties))] - public partial class ContentPropertiesGenerationContext : JsonSerializerContext + private partial class ContentPropertiesGenerationContext : JsonSerializerContext { } - public record XAccntParentMap(); + private record XAccntParentMap(); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(XAccntParentMap))] - public partial class XAccntParentMapGenerationContext : JsonSerializerContext + private partial class XAccntParentMapGenerationContext : JsonSerializerContext { } - public record Datum([property: JsonPropertyName("accessRuleIds")] IReadOnlyList AccessRuleIds, + private record Datum([property: JsonPropertyName("accessRuleIds")] IReadOnlyList AccessRuleIds, [property: JsonPropertyName("childAssetTypeInfo")] IReadOnlyList ChildAssetTypeInfo, [property: JsonPropertyName("contentProperties")] ContentProperties ContentProperties, [property: JsonPropertyName("createdBy")] string CreatedBy, @@ -111,27 +111,27 @@ internal static partial class Helper20240517 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Datum))] - public partial class DatumGenerationContext : JsonSerializerContext + private partial class DatumGenerationContext : JsonSerializerContext { } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Dictionary))] - public partial class DictionaryDatumGenerationContext : JsonSerializerContext + private partial class DictionaryDatumGenerationContext : JsonSerializerContext { } - public record LocationAmazon([property: JsonPropertyName("count")] int Count, + private record LocationAmazon([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(LocationAmazon))] - public partial class LocationAmazonGenerationContext : JsonSerializerContext + private partial class LocationAmazonGenerationContext : JsonSerializerContext { } - public record LocationInfo([property: JsonPropertyName("city")] string City, + private record LocationInfo([property: JsonPropertyName("city")] string City, [property: JsonPropertyName("country")] string Country, [property: JsonPropertyName("countryIso3Code")] string CountryIso3Code, [property: JsonPropertyName("state")] string State, @@ -139,74 +139,74 @@ internal static partial class Helper20240517 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(LocationInfo))] - public partial class LocationInfoGenerationContext : JsonSerializerContext + private partial class LocationInfoGenerationContext : JsonSerializerContext { } - public record SearchData([property: JsonPropertyName("clusterName")] string ClusterName, + private record SearchData([property: JsonPropertyName("clusterName")] string ClusterName, [property: JsonPropertyName("locationId")] string LocationId, [property: JsonPropertyName("locationInfo")] LocationInfo LocationInfo, [property: JsonPropertyName("thingId")] string ThingId); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(SearchData))] - public partial class SearchDataGenerationContext : JsonSerializerContext + private partial class SearchDataGenerationContext : JsonSerializerContext { } - public record AllPerson([property: JsonPropertyName("count")] int Count, + private record AllPerson([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(AllPerson))] - public partial class AllPersonGenerationContext : JsonSerializerContext + private partial class AllPersonGenerationContext : JsonSerializerContext { } - public record PersonAmazon([property: JsonPropertyName("count")] int Count, + private record PersonAmazon([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(PersonAmazon))] - public partial class PersonAmazonGenerationContext : JsonSerializerContext + private partial class PersonAmazonGenerationContext : JsonSerializerContext { } - public record ClusterId([property: JsonPropertyName("count")] int Count, + private record ClusterId([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ClusterId))] - public partial class ClusterIdGenerationContext : JsonSerializerContext + private partial class ClusterIdGenerationContext : JsonSerializerContext { } - public record Thing([property: JsonPropertyName("count")] int Count, + private record Thing([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Thing))] - public partial class ThingGenerationContext : JsonSerializerContext + private partial class ThingGenerationContext : JsonSerializerContext { } - public record Time([property: JsonPropertyName("count")] int Count, + private record Time([property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("match")] string Match, [property: JsonPropertyName("searchData")] SearchData SearchData); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Time))] - public partial class TimeGenerationContext : JsonSerializerContext + private partial class TimeGenerationContext : JsonSerializerContext { } - public record ParentMap([property: JsonPropertyName("FOLDER")] IReadOnlyList FOLDER); + private record ParentMap([property: JsonPropertyName("FOLDER")] IReadOnlyList FOLDER); - public record Aggregations([property: JsonPropertyName("allPeople")] IReadOnlyList AllPeople, + private record Aggregations([property: JsonPropertyName("allPeople")] IReadOnlyList AllPeople, [property: JsonPropertyName("clusterId")] IReadOnlyList ClusterId, [property: JsonPropertyName("location")] IReadOnlyList Location, [property: JsonPropertyName("people")] IReadOnlyList People, @@ -216,23 +216,23 @@ internal static partial class Helper20240517 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Aggregations))] - public partial class AggregationsGenerationContext : JsonSerializerContext + private partial class AggregationsGenerationContext : JsonSerializerContext { } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ParentMap))] - public partial class ParentMapGenerationContext : JsonSerializerContext + private partial class ParentMapGenerationContext : JsonSerializerContext { } - public record RootAmazon([property: JsonPropertyName("aggregations")] Aggregations Aggregations, + private record RootAmazon([property: JsonPropertyName("aggregations")] Aggregations Aggregations, [property: JsonPropertyName("count")] int Count, [property: JsonPropertyName("data")] IReadOnlyList Data); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(RootAmazon))] - public partial class RootAmazonGenerationContext : JsonSerializerContext + private partial class RootAmazonGenerationContext : JsonSerializerContext { } diff --git a/ADO2024/PI2/Helper-2024-07-18.cs b/ADO2024/PI2/Helper-2024-07-18.cs index 2dcb05c..77ac092 100644 --- a/ADO2024/PI2/Helper-2024-07-18.cs +++ b/ADO2024/PI2/Helper-2024-07-18.cs @@ -1,20 +1,37 @@ -using File_Folder_Helper.Models; using Microsoft.Extensions.Logging; using System.Collections.ObjectModel; using System.Text.Json; +using System.Text.Json.Serialization; namespace File_Folder_Helper.ADO2024.PI2; internal static partial class Helper20240718 { + private record Host([property: JsonPropertyName("a")] string? Id, + [property: JsonPropertyName("b")] string? Colon, + [property: JsonPropertyName("c")] string? Hyphen, + [property: JsonPropertyName("d")] string? Line, + [property: JsonPropertyName("e")] string? Count, + [property: JsonPropertyName("f")] string? Segments, + [property: JsonPropertyName("g")] string? Type, + [property: JsonPropertyName("h")] string? Device, + [property: JsonPropertyName("i")] string? Name, + [property: JsonPropertyName("j")] string? Location); + + [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] + [JsonSerializable(typeof(Host[]))] + private partial class HostsSourceGenerationContext : JsonSerializerContext + { + } + private static Host[] GetHosts(ILogger logger, string file) { Host[] results; string lines = File.ReadAllText(file); string json = $"[{lines.Replace("\r\n", ",")}]"; logger.LogDebug(lines); - results = JsonSerializer.Deserialize(json, HostSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(); + results = JsonSerializer.Deserialize(json, HostsSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(); return results; } diff --git a/ADO2024/PI3/Helper-2024-08-22.cs b/ADO2024/PI3/Helper-2024-08-22.cs index 2e6754a..915de6b 100644 --- a/ADO2024/PI3/Helper-2024-08-22.cs +++ b/ADO2024/PI3/Helper-2024-08-22.cs @@ -8,62 +8,62 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20240822 { - public record Record(string? Title, ReadOnlyCollection Tags, string? Completed); + private record Record(string? Title, ReadOnlyCollection Tags, string? Completed); - public record Root([property: JsonPropertyName("headings")] Heading[] Headings, - [property: JsonPropertyName("lanes")] Lane[] Lanes); + private record Root([property: JsonPropertyName("headings")] Heading[] Headings, + [property: JsonPropertyName("lanes")] Lane[] Lanes); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Root))] - internal partial class Helper20240822RootSourceGenerationContext : JsonSerializerContext + private partial class Helper20240822RootSourceGenerationContext : JsonSerializerContext { } - public record Welcome2([property: JsonPropertyName("headings")] Heading[] Headings, - [property: JsonPropertyName("lanes")] Lane[] Lanes); + private record Welcome2([property: JsonPropertyName("headings")] Heading[] Headings, + [property: JsonPropertyName("lanes")] Lane[] Lanes); - public record Heading([property: JsonPropertyName("name")] string Name, - [property: JsonPropertyName("heading")] string HeadingHeading); + private record Heading([property: JsonPropertyName("name")] string Name, + [property: JsonPropertyName("heading")] string HeadingHeading); - public record Lane([property: JsonPropertyName("name")] string Name, - [property: JsonPropertyName("columns")] Column[][] Columns); + private record Lane([property: JsonPropertyName("name")] string Name, + [property: JsonPropertyName("columns")] Column[][] Columns); - public record Column([property: JsonPropertyName("id")] string Id, - [property: JsonPropertyName("name")] string Name, - [property: JsonPropertyName("description")] string Description, - [property: JsonPropertyName("metadata")] Metadata? Metadata, - [property: JsonPropertyName("subTasks")] SubTask[]? SubTasks, - [property: JsonPropertyName("relations")] object[] Relations, - [property: JsonPropertyName("comments")] Comment[] Comments, - [property: JsonPropertyName("column")] string ColumnColumn, - [property: JsonPropertyName("workload")] long Workload, - [property: JsonPropertyName("progress")] long Progress, - [property: JsonPropertyName("remainingWorkload")] long RemainingWorkload, - [property: JsonPropertyName("dueData")] DueData DueData); + private record Column([property: JsonPropertyName("id")] string Id, + [property: JsonPropertyName("name")] string Name, + [property: JsonPropertyName("description")] string Description, + [property: JsonPropertyName("metadata")] Metadata? Metadata, + [property: JsonPropertyName("subTasks")] SubTask[]? SubTasks, + [property: JsonPropertyName("relations")] object[] Relations, + [property: JsonPropertyName("comments")] Comment[] Comments, + [property: JsonPropertyName("column")] string ColumnColumn, + [property: JsonPropertyName("workload")] long Workload, + [property: JsonPropertyName("progress")] long Progress, + [property: JsonPropertyName("remainingWorkload")] long RemainingWorkload, + [property: JsonPropertyName("dueData")] DueData DueData); - public record Comment([property: JsonPropertyName("text")] string Text, - [property: JsonPropertyName("date")] DateTimeOffset Date); + private record Comment([property: JsonPropertyName("text")] string Text, + [property: JsonPropertyName("date")] DateTimeOffset Date); - public record DueData([property: JsonPropertyName("completed")] bool Completed, - [property: JsonPropertyName("completedDate")] object CompletedDate, - [property: JsonPropertyName("dueDate")] DateTimeOffset DueDate, - [property: JsonPropertyName("overdue")] bool Overdue, - [property: JsonPropertyName("dueDelta")] long DueDelta, - [property: JsonPropertyName("dueMessage")] string DueMessage); + private record DueData([property: JsonPropertyName("completed")] bool Completed, + [property: JsonPropertyName("completedDate")] object CompletedDate, + [property: JsonPropertyName("dueDate")] DateTimeOffset DueDate, + [property: JsonPropertyName("overdue")] bool Overdue, + [property: JsonPropertyName("dueDelta")] long DueDelta, + [property: JsonPropertyName("dueMessage")] string DueMessage); - public record Metadata([property: JsonPropertyName("assigned")] string Assigned, - [property: JsonPropertyName("created")] DateTimeOffset Created, - [property: JsonPropertyName("progress")] long? Progress, - [property: JsonPropertyName("started")] DateTimeOffset? Started, - [property: JsonPropertyName("status")] string? Status, - [property: JsonPropertyName("tags")] string[]? Tags, - [property: JsonPropertyName("type")] string? Type, - [property: JsonPropertyName("updated")] DateTimeOffset Updated, - [property: JsonPropertyName("due")] DateTimeOffset? Due, - [property: JsonPropertyName("completed")] DateTimeOffset? Completed); + private record Metadata([property: JsonPropertyName("assigned")] string Assigned, + [property: JsonPropertyName("created")] DateTimeOffset Created, + [property: JsonPropertyName("progress")] long? Progress, + [property: JsonPropertyName("started")] DateTimeOffset? Started, + [property: JsonPropertyName("status")] string? Status, + [property: JsonPropertyName("tags")] string[]? Tags, + [property: JsonPropertyName("type")] string? Type, + [property: JsonPropertyName("updated")] DateTimeOffset Updated, + [property: JsonPropertyName("due")] DateTimeOffset? Due, + [property: JsonPropertyName("completed")] DateTimeOffset? Completed); - public record SubTask([property: JsonPropertyName("text")] string Text, - [property: JsonPropertyName("completed")] bool Completed); + private record SubTask([property: JsonPropertyName("text")] string Text, + [property: JsonPropertyName("completed")] bool Completed); private static ReadOnlyCollection> GetRecords(Column[][] columnCollection) { diff --git a/ADO2024/PI3/Helper-2024-08-28.cs b/ADO2024/PI3/Helper-2024-08-28.cs index 2e9ee72..57b9775 100644 --- a/ADO2024/PI3/Helper-2024-08-28.cs +++ b/ADO2024/PI3/Helper-2024-08-28.cs @@ -10,24 +10,24 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20240828 { - public record HeaderCommon(DateTime Date, - string? Employee, - string? Layer, - string? MesEntity, - string? PSN, - string? Quantity, - string? RDS, - string? Reactor, - string? Recipe, - string? Zone); + private record HeaderCommon(DateTime Date, + string? Employee, + string? Layer, + string? MesEntity, + string? PSN, + string? Quantity, + string? RDS, + string? Reactor, + string? Recipe, + string? Zone); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(HeaderCommon))] - internal partial class HeaderCommonSourceGenerationContext : JsonSerializerContext + private partial class HeaderCommonSourceGenerationContext : JsonSerializerContext { } - public record Record(string? CassetteId, + private record Record(string? CassetteId, ReadOnlyCollection? CassetteSegments, DateTime? Date, string? Employee, diff --git a/ADO2024/PI3/Helper-2024-08-30.cs b/ADO2024/PI3/Helper-2024-08-30.cs index ed4ea80..c5c032a 100644 --- a/ADO2024/PI3/Helper-2024-08-30.cs +++ b/ADO2024/PI3/Helper-2024-08-30.cs @@ -15,7 +15,7 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20240830 { - public record WorkItem(string AreaPath, + private record WorkItem(string AreaPath, string? AssignedTo, int? BusinessValue, DateTime ChangedDate, diff --git a/ADO2024/PI3/Helper-2024-09-25.cs b/ADO2024/PI3/Helper-2024-09-25.cs index 17c8f16..241753b 100644 --- a/ADO2024/PI3/Helper-2024-09-25.cs +++ b/ADO2024/PI3/Helper-2024-09-25.cs @@ -7,12 +7,12 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20240925 { - public record Test(string Name, - long Value); + private record Test(string Name, + long Value); [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ReadOnlyCollection))] - internal partial class TestCollectionSourceGenerationContext : JsonSerializerContext + private partial class TestCollectionSourceGenerationContext : JsonSerializerContext { } diff --git a/ADO2024/PI3/Helper-2024-10-02.cs b/ADO2024/PI3/Helper-2024-10-02.cs index ee75303..a201f07 100644 --- a/ADO2024/PI3/Helper-2024-10-02.cs +++ b/ADO2024/PI3/Helper-2024-10-02.cs @@ -7,17 +7,17 @@ namespace File_Folder_Helper.ADO2024.PI3; internal static partial class Helper20241002 { - public record Record(string? Calculation, - string Chart, - string Group, - string GroupId, - long Id, - string? RawCalculation, - string Test, - string TestId) + private record Record(string? Calculation, + string Chart, + string Group, + string GroupId, + long Id, + string? RawCalculation, + string Test, + string TestId) { - public static Record Get(Record record, string? calculation) => + internal static Record Get(Record record, string? calculation) => new(calculation, record.Chart, record.Group, @@ -31,13 +31,13 @@ internal static partial class Helper20241002 [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ReadOnlyCollection))] - internal partial class RecordCollectionSourceGenerationContext : JsonSerializerContext + private partial class RecordCollectionSourceGenerationContext : JsonSerializerContext { } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(ReadOnlyDictionary))] - internal partial class RecordDictionarySourceGenerationContext : JsonSerializerContext + private partial class RecordDictionarySourceGenerationContext : JsonSerializerContext { } diff --git a/Day/HelperDay.cs b/Day/HelperDay.cs index 28a0f82..b8f2842 100644 --- a/Day/HelperDay.cs +++ b/Day/HelperDay.cs @@ -79,8 +79,8 @@ internal static class HelperDay ADO2024.PI2.Helper20240624.MoveUpOneDirectory(logger, args); else if (args[1] == "Day-Helper-2024-07-11") ADO2024.PI2.Helper20240711.GitRemoteRemove(logger, args); - else if (args[1] == "Day-Helper-2024-07-18") - ADO2024.PI2.Helper20240718.JsonToMarkdown(logger, args); + // else if (args[1] == "Day-Helper-2024-07-18") + // ADO2024.PI2.Helper20240718.JsonToMarkdown(logger, args); else if (args[1] == "Day-Helper-2024-07-24") ADO2024.PI2.Helper20240724.CopyDirectories(logger, args); else if (args[1] == "Day-Helper-2024-07-28") diff --git a/Day/Q42023/Helper-2023-10-24.cs b/Day/Q42023/Helper-2023-10-24.cs index 2f5f3a1..b11da38 100644 --- a/Day/Q42023/Helper-2023-10-24.cs +++ b/Day/Q42023/Helper-2023-10-24.cs @@ -6,13 +6,25 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Day.Q42023; -internal record Drive(string Share, - bool Use, - string User); - -internal static class Helper20231024 +internal static partial class Helper20231024 { + private record Drive(string Share, + bool Use, + string User); + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(Drive))] + private partial class DriveSourceGenerationContext : JsonSerializerContext + { + } + + [JsonSourceGenerationOptions(WriteIndented = true)] + [JsonSerializable(typeof(List))] + private partial class DrivesSourceGenerationContext : JsonSerializerContext + { + } + internal static void NetUse(ILogger logger, string argsZero) { Process? process; @@ -110,16 +122,4 @@ internal static class Helper20231024 } } -} - -[JsonSourceGenerationOptions(WriteIndented = true)] -[JsonSerializable(typeof(Drive))] -internal partial class DriveSourceGenerationContext : JsonSerializerContext -{ -} - -[JsonSourceGenerationOptions(WriteIndented = true)] -[JsonSerializable(typeof(List))] -internal partial class DrivesSourceGenerationContext : JsonSerializerContext -{ } \ No newline at end of file diff --git a/Day/Q42023/Helper-2023-12-22.cs b/Day/Q42023/Helper-2023-12-22.cs index 2ca535a..21a800f 100644 --- a/Day/Q42023/Helper-2023-12-22.cs +++ b/Day/Q42023/Helper-2023-12-22.cs @@ -28,7 +28,7 @@ internal static partial class Helper20231222 string NameWithoutExtension, int? SortOrder); - public record MetadataConfiguration(int ResultAllInOneSubdirectoryLength, int Offset, int IntMinValueLength); + private record MetadataConfiguration(int ResultAllInOneSubdirectoryLength, int Offset, int IntMinValueLength); private static short GetSortOrderOnlyLengthIndex(MetadataConfiguration metadataConfiguration) => (short)metadataConfiguration.Offset.ToString().Length; diff --git a/Models/Binder/AppSettings.cs b/Models/Binder/AppSettings.cs index 910abed..4fe31a2 100644 --- a/Models/Binder/AppSettings.cs +++ b/Models/Binder/AppSettings.cs @@ -60,7 +60,7 @@ public class AppSettings return result; } - public static Models.AppSettings Get(IConfigurationRoot configurationRoot) + internal static Models.AppSettings Get(IConfigurationRoot configurationRoot) { Models.AppSettings result; #pragma warning disable IL3050, IL2026 diff --git a/Models/Birth.cs b/Models/Birth.cs index c887a1f..e9f4318 100644 --- a/Models/Birth.cs +++ b/Models/Birth.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Birth(DateOnly? Date, +internal record Birth(DateOnly? Date, string? Note, List Continue) { diff --git a/Models/Change.cs b/Models/Change.cs index c467e9f..f929174 100644 --- a/Models/Change.cs +++ b/Models/Change.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Change(DateOnly? Date, +internal record Change(DateOnly? Date, string? Note, List Continue) { diff --git a/Models/Comment.cs b/Models/Comment.cs index d2f859a..c452b65 100644 --- a/Models/Comment.cs +++ b/Models/Comment.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Comment([property: JsonPropertyName("workItemId")] int? WorkItemId, +internal record Comment([property: JsonPropertyName("workItemId")] int? WorkItemId, [property: JsonPropertyName("id")] int? Id, [property: JsonPropertyName("version")] int? Version, [property: JsonPropertyName("text")] string? Text, diff --git a/Models/CreatedBy.cs b/Models/CreatedBy.cs index e3c3806..3963c6c 100644 --- a/Models/CreatedBy.cs +++ b/Models/CreatedBy.cs @@ -4,7 +4,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record CreatedBy([property: JsonPropertyName("displayName")] string? DisplayName, +internal record CreatedBy([property: JsonPropertyName("displayName")] string? DisplayName, [property: JsonPropertyName("url")] string? Url, [property: JsonPropertyName("_links")] Links Links, [property: JsonPropertyName("id")] string? Id, diff --git a/Models/Death.cs b/Models/Death.cs index b43a7e8..a8917ec 100644 --- a/Models/Death.cs +++ b/Models/Death.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Death(bool? Is, +internal record Death(bool? Is, DateOnly? Date, string? Note, List Continue) diff --git a/Models/Host.cs b/Models/Host.cs index b09ee29..800ee70 100644 --- a/Models/Host.cs +++ b/Models/Host.cs @@ -1,20 +1,20 @@ -using System.Text.Json.Serialization; +// using System.Text.Json.Serialization; -namespace File_Folder_Helper.Models; +// namespace File_Folder_Helper.Models; -public record Host([property: JsonPropertyName("a")] string? Id, - [property: JsonPropertyName("b")] string? Colon, - [property: JsonPropertyName("c")] string? Hyphen, - [property: JsonPropertyName("d")] string? Line, - [property: JsonPropertyName("e")] string? Count, - [property: JsonPropertyName("f")] string? Segments, - [property: JsonPropertyName("g")] string? Type, - [property: JsonPropertyName("h")] string? Device, - [property: JsonPropertyName("i")] string? Name, - [property: JsonPropertyName("j")] string? Location); +// internal record Host([property: JsonPropertyName("a")] string? Id, +// [property: JsonPropertyName("b")] string? Colon, +// [property: JsonPropertyName("c")] string? Hyphen, +// [property: JsonPropertyName("d")] string? Line, +// [property: JsonPropertyName("e")] string? Count, +// [property: JsonPropertyName("f")] string? Segments, +// [property: JsonPropertyName("g")] string? Type, +// [property: JsonPropertyName("h")] string? Device, +// [property: JsonPropertyName("i")] string? Name, +// [property: JsonPropertyName("j")] string? Location); -[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] -[JsonSerializable(typeof(Host[]))] -public partial class HostSourceGenerationContext : JsonSerializerContext -{ -} \ No newline at end of file +// [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)] +// [JsonSerializable(typeof(Host[]))] +// internal partial class HostsSourceGenerationContext : JsonSerializerContext +// { +// } \ No newline at end of file diff --git a/Models/ModifiedBy.cs b/Models/ModifiedBy.cs index a55023e..8532012 100644 --- a/Models/ModifiedBy.cs +++ b/Models/ModifiedBy.cs @@ -4,7 +4,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record ModifiedBy([property: JsonPropertyName("displayName")] string? DisplayName, +internal record ModifiedBy([property: JsonPropertyName("displayName")] string? DisplayName, [property: JsonPropertyName("url")] string? Url, [property: JsonPropertyName("_links")] Links Links, [property: JsonPropertyName("id")] string? Id, diff --git a/Models/Name.cs b/Models/Name.cs index f2dbb84..2719cd1 100644 --- a/Models/Name.cs +++ b/Models/Name.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Name(string? ForwardSlashFull, +internal record Name(string? ForwardSlashFull, string? Given, string? Sur, string? Nick, diff --git a/Models/NginxFileSystem.cs b/Models/NginxFileSystem.cs index 9682266..22f091d 100644 --- a/Models/NginxFileSystem.cs +++ b/Models/NginxFileSystem.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record NginxFileSystem(string Name, +internal record NginxFileSystem(string Name, string Type, string MTime, float Size) diff --git a/Models/PackageJson.cs b/Models/PackageJson.cs index 4e0e515..243789a 100644 --- a/Models/PackageJson.cs +++ b/Models/PackageJson.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record PackageJson([property: JsonPropertyName("name")] string Name, +internal record PackageJson([property: JsonPropertyName("name")] string Name, [property: JsonPropertyName("time")] Dictionary Times, [property: JsonPropertyName("_rev")] string Rev, [property: JsonPropertyName("_id")] string Id); diff --git a/Models/Person.cs b/Models/Person.cs index a6c036b..5bdc3f0 100644 --- a/Models/Person.cs +++ b/Models/Person.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record Person(long Id, +internal record Person(long Id, Name? Name, char? Sex, string? UId, diff --git a/Models/VSCodeTasks.cs b/Models/VSCodeTasks.cs index 94bc40b..cf85c5f 100644 --- a/Models/VSCodeTasks.cs +++ b/Models/VSCodeTasks.cs @@ -3,7 +3,7 @@ using System.Text.Json.Serialization; namespace File_Folder_Helper.Models; -public record VSCodeTask([property: JsonPropertyName("label")] string? Label, +internal record VSCodeTask([property: JsonPropertyName("label")] string? Label, [property: JsonPropertyName("command")] string? Command, [property: JsonPropertyName("type")] string? Type, [property: JsonPropertyName("args")] IReadOnlyList? Arguments, @@ -24,7 +24,7 @@ internal partial class VSCodeTaskSourceGenerationContext : JsonSerializerContext { } -public record VSCodeTasks([property: JsonPropertyName("version")] string? Version, +internal record VSCodeTasks([property: JsonPropertyName("version")] string? Version, [property: JsonPropertyName("tasks")] VSCodeTask[]? TaskCollection) {