mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
*final* fix of the plugin registry.
This commit is contained in:
@@ -64,13 +64,13 @@ public class PluginRegister
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>List of writable media image plugins</summary>
|
/// <summary>List of writable media image plugins</summary>
|
||||||
public SortedDictionary<string, IWritableImage> WritableImages
|
public SortedDictionary<string, IBaseWritableImage> WritableImages
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
SortedDictionary<string, IWritableImage> mediaImages = new();
|
SortedDictionary<string, IBaseWritableImage> mediaImages = new();
|
||||||
|
|
||||||
foreach(IWritableImage plugin in _serviceProvider.GetServices<IWritableImage>())
|
foreach(IBaseWritableImage plugin in _serviceProvider.GetServices<IBaseWritableImage>())
|
||||||
mediaImages[plugin.Name.ToLower()] = plugin;
|
mediaImages[plugin.Name.ToLower()] = plugin;
|
||||||
|
|
||||||
return mediaImages;
|
return mediaImages;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Logging;
|
using Aaru.Logging;
|
||||||
@@ -55,7 +54,7 @@ public static class ImageFormat
|
|||||||
IBaseImage imageFormat = null;
|
IBaseImage imageFormat = null;
|
||||||
|
|
||||||
// Check all but RAW plugin
|
// Check all but RAW plugin
|
||||||
foreach(IMediaImage imagePlugin in plugins.MediaImages.Values.Concat(plugins.WritableImages.Values))
|
foreach(IMediaImage imagePlugin in plugins.MediaImages.Values)
|
||||||
{
|
{
|
||||||
if(imagePlugin is null) continue;
|
if(imagePlugin is null) continue;
|
||||||
|
|
||||||
@@ -107,7 +106,7 @@ public static class ImageFormat
|
|||||||
if(imageFormat != null) return imageFormat;
|
if(imageFormat != null) return imageFormat;
|
||||||
|
|
||||||
// Check only RAW plugin
|
// Check only RAW plugin
|
||||||
foreach(IMediaImage imagePlugin in plugins.MediaImages.Values.Concat(plugins.WritableImages.Values))
|
foreach(IMediaImage imagePlugin in plugins.MediaImages.Values)
|
||||||
{
|
{
|
||||||
if(imagePlugin is null) continue;
|
if(imagePlugin is null) continue;
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ sealed class FormatsCommand : Command<FormatsCommand.Settings>
|
|||||||
|
|
||||||
table = new Table
|
table = new Table
|
||||||
{
|
{
|
||||||
Title = new TableTitle(string.Format(UI.Supported_filters_0, plugins.WritableImages.Count))
|
Title = new TableTitle(string.Format(UI.Read_write_media_image_formats_0, plugins.WritableImages.Count))
|
||||||
};
|
};
|
||||||
|
|
||||||
table.Border(TableBorder.Rounded);
|
table.Border(TableBorder.Rounded);
|
||||||
@@ -144,7 +144,7 @@ sealed class FormatsCommand : Command<FormatsCommand.Settings>
|
|||||||
|
|
||||||
table.AddColumn(new TableColumn(new Markup(UI.Title_Media_image_format).Centered()));
|
table.AddColumn(new TableColumn(new Markup(UI.Title_Media_image_format).Centered()));
|
||||||
|
|
||||||
foreach(IWritableImage plugin in plugins.WritableImages.Values)
|
foreach(IBaseWritableImage plugin in plugins.WritableImages.Values)
|
||||||
{
|
{
|
||||||
if(plugin is null) continue;
|
if(plugin is null) continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user