1234567891011121314151617181920212223 |
- using HTEXLib.Translator;
- using Microsoft.Extensions.DependencyInjection;
- using Microsoft.Extensions.DependencyInjection.Extensions;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace HTEXLib.Translator
- {
- public static class HtexExtensions
- {
- public static IServiceCollection AddHtexTranslator(this IServiceCollection services,string configPath)
- {
- if (services == null) throw new ArgumentNullException(nameof(services));
- services.TryAddScoped<PPTX2HTEXTranslator>();
- services.TryAddScoped<DOXC2HTMLTranslator>();
- //services.TryAddScoped<HTML2ITEMTranslator>();
- // services.TryAddSingleton<HTML2ITEMV2Translator>(new HTML2ITEMV2Translator(configPath));
- services.TryAddSingleton<HTML2ITEMV3Translator>(new HTML2ITEMV3Translator(configPath));
- return services;
- }
- }
- }
|