REFACTOR: All refactor in DiscImageChef.Core.

This commit is contained in:
2017-12-21 23:00:30 +00:00
parent effdcb4e0e
commit 7f829422a8
37 changed files with 892 additions and 1143 deletions

View File

@@ -44,11 +44,10 @@ namespace DiscImageChef.Core
{
try
{
ImagePlugin imageFormat;
PluginBase plugins = new PluginBase();
plugins.RegisterAllPlugins();
imageFormat = null;
ImagePlugin imageFormat = null;
// Check all but RAW plugin
foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin => imageplugin.PluginUuid != new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))) try
@@ -60,10 +59,12 @@ namespace DiscImageChef.Core
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }
catch { // ignored
}
if(imageFormat != null) return imageFormat;
// Check only RAW plugin
if(imageFormat == null)
foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values.Where(imageplugin => imageplugin.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))) try
{
DicConsole.DebugWriteLine("Format detection", "Trying plugin {0}", imageplugin.Name);
@@ -73,11 +74,10 @@ namespace DiscImageChef.Core
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }
catch { // ignored
}
// Still not recognized
if(imageFormat == null) return null;
return imageFormat;
}
catch { return null; }