diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs index 983c0e6..1666df4 100644 --- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs +++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs @@ -4,57 +4,57 @@ namespace RhSolutions.AddIn; public sealed class RhSolutionsAddIn : IExcelAddIn { - public static Application Excel { get; private set; } - public static ServiceProvider ServiceProvider { get; private set; } - public static IAddInConfiguration Configuration { get; private set; } + public static Application Excel { get; private set; } + public static ServiceProvider ServiceProvider { get; private set; } + public static IAddInConfiguration Configuration { get; private set; } - public void AutoOpen() - { - IServiceCollection Services = new ServiceCollection(); + public void AutoOpen() + { + IServiceCollection Services = new ServiceCollection(); - Services.AddHttpClient() - .AddMemoryCache() - .AddSingleton((Application)ExcelDnaUtil.Application) - .AddSingleton() - .AddSingleton() - .AddSingleton() - .AddTransient(); + Services.AddHttpClient() + .AddMemoryCache() + .AddSingleton((Application)ExcelDnaUtil.Application) + .AddSingleton() + .AddSingleton() + .AddSingleton() + .AddTransient(); - Services.AddSingleton(); - Services.AddTransient() - .AddTransient(s => s.GetService()); - Services.AddTransient() - .AddTransient(s => s.GetService()); - Services.AddTransient() - .AddTransient(s => s.GetService()); + Services.AddSingleton(); + Services.AddTransient() + .AddTransient(s => s.GetService()); + Services.AddTransient() + .AddTransient(s => s.GetService()); + Services.AddTransient() + .AddTransient(s => s.GetService()); - Services.AddSingleton(); - Services.AddTransient() - .AddTransient(s => s.GetService()); - Services.AddTransient() - .AddTransient(s => s.GetService()); + Services.AddSingleton(); + Services.AddTransient() + .AddTransient(s => s.GetService()); + Services.AddTransient() + .AddTransient(s => s.GetService()); - Services.AddSingleton(); - Services.AddTransient() - .AddTransient(s => s.GetService()); - Services.AddTransient() - .AddTransient(s => s.GetService()); + Services.AddSingleton(); + Services.AddTransient() + .AddTransient(s => s.GetService()); + Services.AddTransient() + .AddTransient(s => s.GetService()); - Services.AddSingleton(); + Services.AddSingleton(); - ServiceProvider = Services.BuildServiceProvider(); - Configuration = ServiceProvider.GetService(); - Excel = ServiceProvider.GetService(); + ServiceProvider = Services.BuildServiceProvider(); + Configuration = ServiceProvider.GetService(); + Excel = ServiceProvider.GetService(); - EventsUtil.Initialize(); + EventsUtil.Initialize(); - ServicePointManager.SecurityProtocol = - SecurityProtocolType.Tls12; - ServicePointManager.DefaultConnectionLimit = 50; - } + ServicePointManager.SecurityProtocol = + SecurityProtocolType.Tls12; + ServicePointManager.DefaultConnectionLimit = 50; + } - public void AutoClose() - { - EventsUtil.Uninitialize(); - } + public void AutoClose() + { + EventsUtil.Uninitialize(); + } } diff --git a/RhSolutions.AddIn/Controllers/RibbonController.cs b/RhSolutions.AddIn/Controllers/RibbonController.cs index aecdc02..9123940 100644 --- a/RhSolutions.AddIn/Controllers/RibbonController.cs +++ b/RhSolutions.AddIn/Controllers/RibbonController.cs @@ -9,127 +9,130 @@ namespace RhSolutions.Controllers; [ComVisible(true)] public class RibbonController : ExcelRibbon { - private static IRibbonUI ribbonUi; - private static bool _workbookIsValid; + private static IRibbonUI ribbonUi; + private static bool _workbookIsValid; - public override string GetCustomUI(string RibbonID) - { - return @" - - - - - -