Move partitions plugins to a separate library.

This commit is contained in:
2015-10-05 19:58:42 +01:00
parent 4a3583d13e
commit fda7fee90c
14 changed files with 178 additions and 40 deletions

View File

@@ -60,7 +60,9 @@ namespace DiscImageChef
public void RegisterAllPlugins()
{
Assembly assembly = Assembly.GetAssembly(typeof(ImagePlugin));
Assembly assembly;
assembly = Assembly.GetAssembly(typeof(ImagePlugin));
foreach (Type type in assembly.GetTypes())
{
@@ -78,6 +80,24 @@ namespace DiscImageChef
}
}
assembly = Assembly.GetAssembly(typeof(PartPlugin));
foreach (Type type in assembly.GetTypes())
{
try
{
if (type.IsSubclassOf(typeof(PartPlugin)))
{
PartPlugin plugin = (PartPlugin)type.GetConstructor(Type.EmptyTypes).Invoke(new object[] { });
RegisterPartPlugin(plugin);
}
}
catch (Exception exception)
{
Console.WriteLine(exception);
}
}
assembly = Assembly.GetExecutingAssembly();
foreach (Type type in assembly.GetTypes())
@@ -89,12 +109,6 @@ namespace DiscImageChef
Plugin plugin = (Plugin)type.GetConstructor(new [] { typeof(PluginBase) }).Invoke(new object[] { this });
RegisterPlugin(plugin);
}
else if (type.IsSubclassOf(typeof(PartPlugin)))
{
PartPlugin partplugin = (PartPlugin)type.GetConstructor(new [] { typeof(PluginBase) }).Invoke(new object[] { this });
RegisterPartPlugin(partplugin);
}
}
catch (Exception exception)
{