private record

This commit is contained in:
2024-10-19 09:32:22 -07:00
parent 0ee1846c72
commit 19326df4c6
27 changed files with 206 additions and 168 deletions

View File

@ -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<Drive>))]
private partial class DrivesSourceGenerationContext : JsonSerializerContext
{
}
internal static void NetUse(ILogger<Worker> 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<Drive>))]
internal partial class DrivesSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -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;