Revert "Refactoring Excel application field"
This reverts commit 56112eae51
.
This commit is contained in:
parent
f0fca06beb
commit
964bb01a80
@ -4,7 +4,7 @@ namespace RhSolutions.AddIn;
|
|||||||
|
|
||||||
public sealed class RhSolutionsAddIn : IExcelAddIn
|
public sealed class RhSolutionsAddIn : IExcelAddIn
|
||||||
{
|
{
|
||||||
public static readonly Application Excel = (Application)ExcelDnaUtil.Application;
|
public static Application Excel { get; private set; }
|
||||||
public static ServiceProvider ServiceProvider { get; private set; }
|
public static ServiceProvider ServiceProvider { get; private set; }
|
||||||
public static IAddInConfiguration Configuration { get; private set; }
|
public static IAddInConfiguration Configuration { get; private set; }
|
||||||
|
|
||||||
@ -14,6 +14,7 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
|
|||||||
|
|
||||||
Services.AddHttpClient()
|
Services.AddHttpClient()
|
||||||
.AddMemoryCache()
|
.AddMemoryCache()
|
||||||
|
.AddSingleton((Application)ExcelDnaUtil.Application)
|
||||||
.AddSingleton<IAddInConfiguration, AddInConfiguration>()
|
.AddSingleton<IAddInConfiguration, AddInConfiguration>()
|
||||||
.AddSingleton<IDatabaseClient, DatabaseClient>()
|
.AddSingleton<IDatabaseClient, DatabaseClient>()
|
||||||
.AddSingleton<ICurrencyClient, CurrencyClient>()
|
.AddSingleton<ICurrencyClient, CurrencyClient>()
|
||||||
@ -43,6 +44,7 @@ public sealed class RhSolutionsAddIn : IExcelAddIn
|
|||||||
|
|
||||||
ServiceProvider = Services.BuildServiceProvider();
|
ServiceProvider = Services.BuildServiceProvider();
|
||||||
Configuration = ServiceProvider.GetService<IAddInConfiguration>();
|
Configuration = ServiceProvider.GetService<IAddInConfiguration>();
|
||||||
|
Excel = ServiceProvider.GetService<Application>();
|
||||||
|
|
||||||
EventsUtil.Initialize();
|
EventsUtil.Initialize();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user