Code refactor.

This commit is contained in:
2020-08-22 21:37:02 +01:00
parent b4cd7f22bf
commit 6c78f0c769
33 changed files with 5624 additions and 3480 deletions

View File

@@ -43,7 +43,7 @@ namespace apprepodbmgr.Core
{
try
{
PluginBase plugins = new PluginBase();
var plugins = new PluginBase();
IMediaImage imageFormat = null;
@@ -53,37 +53,45 @@ namespace apprepodbmgr.Core
)
try
{
if(!imageplugin.Identify(imageFilter)) continue;
if(!imageplugin.Identify(imageFilter))
continue;
imageFormat = imageplugin;
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }
catch {}
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
// Check only RAW plugin
if(imageFormat != null) return imageFormat;
if(imageFormat != null)
return imageFormat;
foreach(IMediaImage imageplugin in
plugins.ImagePluginsList.Values.Where(p => p.Id == new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
)
try
{
if(!imageplugin.Identify(imageFilter)) continue;
if(!imageplugin.Identify(imageFilter))
continue;
imageFormat = imageplugin;
break;
}
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
catch { }
catch {}
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
// Still not recognized
return imageFormat;
}
catch { return null; }
catch
{
return null;
}
}
}
}