diff options
-rw-r--r-- | RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs | 2 | ||||
-rw-r--r-- | RhSolutions.AddIn/Services/EventsUtil.cs | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs index 58002ee..aad1302 100644 --- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs +++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs @@ -21,7 +21,7 @@ namespace RhSolutions.AddIn Services.AddHttpClient() .AddSingleton<IDatabaseClient, RhDatabaseClient>() .AddSingleton<IAddInConfiguration, AddInConfiguration>() - .AddSingleton(ExcelDnaUtil.Application); + .AddSingleton((Application)ExcelDnaUtil.Application); ServiceProvider = Services.BuildServiceProvider(); Configuration = ServiceProvider.GetService<IAddInConfiguration>(); diff --git a/RhSolutions.AddIn/Services/EventsUtil.cs b/RhSolutions.AddIn/Services/EventsUtil.cs index 7d96d23..bd7dd7b 100644 --- a/RhSolutions.AddIn/Services/EventsUtil.cs +++ b/RhSolutions.AddIn/Services/EventsUtil.cs @@ -7,21 +7,19 @@ namespace RhSolutions.Services { internal static class EventsUtil { - private static readonly Application Excel = RhSolutionsAddIn.Excel; - public static void Initialize() { - Excel.SheetSelectionChange += RefreshExportButton; - Excel.SheetActivate += RefreshConvertButton; - Excel.WorkbookActivate += RefreshConvertButton; + RhSolutionsAddIn.Excel.SheetSelectionChange += RefreshExportButton; + RhSolutionsAddIn.Excel.SheetActivate += RefreshConvertButton; + RhSolutionsAddIn.Excel.WorkbookActivate += RefreshConvertButton; RhSolutionsAddIn.Configuration.OnSettingsChange += RefreshSettingTitle; } public static void Uninitialize() { - Excel.SheetSelectionChange -= RefreshExportButton; - Excel.SheetActivate -= RefreshConvertButton; - Excel.WorkbookActivate -= RefreshConvertButton; + RhSolutionsAddIn.Excel.SheetSelectionChange -= RefreshExportButton; + RhSolutionsAddIn.Excel.SheetActivate -= RefreshConvertButton; + RhSolutionsAddIn.Excel.WorkbookActivate -= RefreshConvertButton; RhSolutionsAddIn.Configuration.OnSettingsChange -= RefreshSettingTitle; } |