[Plugin system] Move floppy images to dependency injection.

This commit is contained in:
2023-10-06 00:14:37 +01:00
parent 509f77036d
commit 79680da4e9
3 changed files with 8 additions and 8 deletions

View File

@@ -76,16 +76,16 @@ public sealed class PluginsViewModel : ViewModelBase
});
}
foreach(Type imageType in PluginRegister.Singleton.FloppyImages.Values)
foreach(IFloppyImage floppyImage in PluginRegister.Singleton.FloppyImages.Values)
{
if(Activator.CreateInstance(imageType) is not IFloppyImage floppyImage)
if(floppyImage is null)
continue;
FloppyImages.Add(new PluginModel
{
Name = floppyImage.Name,
Uuid = floppyImage.Id,
Version = Assembly.GetAssembly(imageType)?.GetName().Version?.ToString(),
Version = Assembly.GetAssembly(floppyImage.GetType())?.GetName().Version?.ToString(),
Author = floppyImage.Author
});
}