From 7d188fa7fe9ff62e263c2a64252843e4777a2bbb Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 14 Dec 2022 20:56:01 +0000 Subject: [PATCH] Move plugin registers to source generator. --- Aaru.Checksums.csproj | 4 ++++ Register.cs | 44 +++---------------------------------------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/Aaru.Checksums.csproj b/Aaru.Checksums.csproj index e373bdd14..4652e3c5c 100644 --- a/Aaru.Checksums.csproj +++ b/Aaru.Checksums.csproj @@ -28,6 +28,7 @@ Natalia Portillo <claunia@claunia.com> true true + true CS1591;CS1574 @@ -62,4 +63,7 @@ + + + \ No newline at end of file diff --git a/Register.cs b/Register.cs index 0b8db8dc9..cedfda2c1 100644 --- a/Register.cs +++ b/Register.cs @@ -36,49 +36,11 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; using Aaru.CommonTypes.Interfaces; namespace Aaru.Checksums; +// Needs to have the interface here so the source generator knows THIS IS the class +// ReSharper disable once RedundantExtendsListEntry /// -public sealed class Register : IPluginRegister -{ - /// - public List GetAllChecksumPlugins() => Assembly.GetExecutingAssembly().GetTypes(). - Where(t => t.GetInterfaces().Contains(typeof(IChecksum))). - Where(t => t.IsClass).ToList(); - - /// - public List GetAllFilesystemPlugins() => null; - - /// - public List GetAllFilterPlugins() => null; - - /// - public List GetAllFloppyImagePlugins() => null; - - /// - public List GetAllMediaImagePlugins() => null; - - /// - public List GetAllPartitionPlugins() => null; - - /// - public List GetAllReadOnlyFilesystemPlugins() => null; - - /// - public List GetAllWritableFloppyImagePlugins() => null; - - /// - public List GetAllWritableImagePlugins() => null; - - /// - public List GetAllArchivePlugins() => null; - - /// - public List GetAllByteAddressablePlugins() => null; -} \ No newline at end of file +public sealed partial class Register : IPluginRegister {} \ No newline at end of file