mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 15:11:10 +00:00
Adds book reading support with EPUB and PDF reader plugins
This commit is contained in:
1 parent
275fd83ff2
commit
f7ccdf3d1c
271 files changed
+11501
-361
No files matched your search
@@ -0,0 +1,30 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Plugins.Contracts.Core.Reading;
|
||||
using Lumina.Plugins.Epub.Core;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Plugins.Epub.Common.DependencyInjection;
|
||||
|
||||
/// <summary>
|
||||
/// Utility class for registering the services of the EPUB format reader into the Dependency Injection container.
|
||||
/// </summary>
|
||||
internal static class EpubServices
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers the services of the EPUB format reader into the Dependency Injection container.
|
||||
/// </summary>
|
||||
/// <param name="services">The service collection to add the services to.</param>
|
||||
/// <param name="pluginId">The unique identifier of the plugin that provides the book reader.</param>
|
||||
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
|
||||
internal static IServiceCollection AddEpubReader(this IServiceCollection services, Guid pluginId)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(services);
|
||||
|
||||
// Register the book reader as a keyed by pluginId transient service, so it can be resolved specifically among other IBookReader implementations.
|
||||
services.AddKeyedTransient<IBookReader, EpubReader>(pluginId);
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user