diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index 2dae0eed..3a432e68 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -469,7 +469,6 @@ namespace DiscImageChef.Core.Devices.Dumping (double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FiltersList filtersList = new FiltersList(); IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".bin"); diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 8229560f..07959e1d 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -594,7 +594,6 @@ namespace DiscImageChef.Core.Devices.Dumping (double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FiltersList filtersList = new FiltersList(); IFilter inputFilter = filtersList.GetFilter(outputPrefix + outputExtension); diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index 09a34d20..a4749cd8 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -451,7 +451,6 @@ namespace DiscImageChef.Core.Devices.Dumping (double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FiltersList filtersList = new FiltersList(); IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".bin"); diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index 76abd234..cde46f54 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -794,7 +794,6 @@ namespace DiscImageChef.Core.Devices.Dumping (double)BLOCK_SIZE * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FiltersList filtersList = new FiltersList(); IFilter inputFilter = filtersList.GetFilter(outputPrefix + ".iso"); diff --git a/DiscImageChef.Core/Filesystems.cs b/DiscImageChef.Core/Filesystems.cs index 7135807f..0effcf57 100644 --- a/DiscImageChef.Core/Filesystems.cs +++ b/DiscImageChef.Core/Filesystems.cs @@ -49,7 +49,6 @@ namespace DiscImageChef.Core public static void Identify(IMediaImage imagePlugin, out List idPlugins, Partition partition) { PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); idPlugins = (from plugin in plugins.PluginsList.Values where plugin.Identify(imagePlugin, partition) diff --git a/DiscImageChef.Core/ImageFormat.cs b/DiscImageChef.Core/ImageFormat.cs index b097ba4f..d1379273 100644 --- a/DiscImageChef.Core/ImageFormat.cs +++ b/DiscImageChef.Core/ImageFormat.cs @@ -50,7 +50,6 @@ namespace DiscImageChef.Core try { PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); IMediaImage imageFormat = null; diff --git a/DiscImageChef.Core/Partitions.cs b/DiscImageChef.Core/Partitions.cs index 38e81aff..e9ed887c 100644 --- a/DiscImageChef.Core/Partitions.cs +++ b/DiscImageChef.Core/Partitions.cs @@ -52,7 +52,6 @@ namespace DiscImageChef.Core public static List GetAll(IMediaImage image) { PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); List foundPartitions = new List(); List childPartitions = new List(); List checkedLocations = new List(); diff --git a/DiscImageChef.Core/PluginBase.cs b/DiscImageChef.Core/PluginBase.cs index 5a16837c..1e0cd717 100644 --- a/DiscImageChef.Core/PluginBase.cs +++ b/DiscImageChef.Core/PluginBase.cs @@ -50,15 +50,15 @@ namespace DiscImageChef.Core /// /// List of all media image plugins /// - public SortedDictionary ImagePluginsList; + public readonly SortedDictionary ImagePluginsList; /// /// List of all partition plugins /// - public SortedDictionary PartPluginsList; + public readonly SortedDictionary PartPluginsList; /// /// List of all filesystem plugins /// - public SortedDictionary PluginsList; + public readonly SortedDictionary PluginsList; /// /// Initializes the plugins lists @@ -68,13 +68,7 @@ namespace DiscImageChef.Core PluginsList = new SortedDictionary(); PartPluginsList = new SortedDictionary(); ImagePluginsList = new SortedDictionary(); - } - - /// - /// Fills the plugins lists - /// - public void RegisterAllPlugins() - { + Assembly assembly = Assembly.GetAssembly(typeof(IMediaImage)); foreach(Type type in assembly.GetTypes().Where(t => t.GetInterfaces().Contains(typeof(IMediaImage)))) diff --git a/DiscImageChef.Core/Sidecar/Sidecar.cs b/DiscImageChef.Core/Sidecar/Sidecar.cs index 078af7c4..67bb0648 100644 --- a/DiscImageChef.Core/Sidecar/Sidecar.cs +++ b/DiscImageChef.Core/Sidecar/Sidecar.cs @@ -53,7 +53,6 @@ namespace DiscImageChef.Core { CICMMetadataType sidecar = new CICMMetadataType(); PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FileInfo fi = new FileInfo(imagePath); FileStream fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read); diff --git a/DiscImageChef/Commands/ExtractFiles.cs b/DiscImageChef/Commands/ExtractFiles.cs index 22105501..a08271c4 100644 --- a/DiscImageChef/Commands/ExtractFiles.cs +++ b/DiscImageChef/Commands/ExtractFiles.cs @@ -78,7 +78,6 @@ namespace DiscImageChef.Commands } PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); try { diff --git a/DiscImageChef/Commands/Formats.cs b/DiscImageChef/Commands/Formats.cs index ed3220ae..8ff563f1 100644 --- a/DiscImageChef/Commands/Formats.cs +++ b/DiscImageChef/Commands/Formats.cs @@ -45,7 +45,6 @@ namespace DiscImageChef.Commands internal static void ListFormats(FormatsOptions formatsOptions) { PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); FiltersList filtersList = new FiltersList(); DicConsole.WriteLine("Supported filters:"); diff --git a/DiscImageChef/Commands/Ls.cs b/DiscImageChef/Commands/Ls.cs index ee63b095..e5ed4698 100644 --- a/DiscImageChef/Commands/Ls.cs +++ b/DiscImageChef/Commands/Ls.cs @@ -74,7 +74,6 @@ namespace DiscImageChef.Commands } PluginBase plugins = new PluginBase(); - plugins.RegisterAllPlugins(); try {