mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Plugin system] Move writable media images to dependency injection.
This commit is contained in:
@@ -232,16 +232,16 @@ public class PluginRegisterGenerator : ISourceGenerator
|
||||
|
||||
if(writableImagePlugins?.Count > 0)
|
||||
{
|
||||
sb.AppendLine(" public List<Type> GetAllWritableImagePlugins() => new()");
|
||||
sb.AppendLine(" public void RegisterWritableImagePlugins(IServiceCollection services)");
|
||||
sb.AppendLine(" {");
|
||||
|
||||
foreach(string plugin in writableImagePlugins)
|
||||
sb.AppendLine($" typeof({plugin}),");
|
||||
sb.AppendLine($" services.AddTransient<IBaseWritableImage, {plugin}>();");
|
||||
|
||||
sb.AppendLine(" };");
|
||||
sb.AppendLine(" }");
|
||||
}
|
||||
else
|
||||
sb.AppendLine(" public List<Type> GetAllWritableImagePlugins() => null;");
|
||||
sb.AppendLine(" public void RegisterWritableImagePlugins(IServiceCollection services) {}");
|
||||
|
||||
sb.AppendLine();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user