diff options
Diffstat (limited to 'ExcelAddIn.cs')
-rw-r--r-- | ExcelAddIn.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ExcelAddIn.cs b/ExcelAddIn.cs new file mode 100644 index 0000000..1a5d5f1 --- /dev/null +++ b/ExcelAddIn.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.DependencyInjection; +using ExcelAddIn.Services; +using System.Text; + +public class MyAddIn : IExcelAddIn +{ + public static ServiceProvider ServiceProvider { get; private set; } + public void AutoOpen() + { + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + IServiceCollection Services = new ServiceCollection(); + Services.AddHttpClient() + .AddSingleton<ICurrencyClient, CurrencyClient>(); + ServiceProvider = Services.BuildServiceProvider(); + } + + public void AutoClose() + { + } +}
\ No newline at end of file |