1
0
ExcelAddIn/ExcelAddIn.cs

20 lines
619 B
C#
Raw Normal View History

2023-06-09 07:27:43 +03:00
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()
    {
    }
}