From 8a869e73fb1873b1f85203b7a4a18dc8a2325a11 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 8 Dec 2021 14:38:23 +0300 Subject: Rename dir ExcelDNA -> AddIn --- Source/AddIn/AddIn.cs | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Source/AddIn/AddIn.cs (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs new file mode 100644 index 0000000..3c82406 --- /dev/null +++ b/Source/AddIn/AddIn.cs @@ -0,0 +1,53 @@ +using ExcelDna.Integration; +using ExcelDna.Registration; +using Microsoft.Win32; +using System.Net.Http; + +namespace RehauSku.Assist +{ + public enum ResponseOrder + { + Default, + Relevance, + Name, + Price, + Series + } + + public class AddIn : IExcelAddIn + { + public static readonly HttpClient httpClient = new HttpClient(); + public static ResponseOrder responseOrder; + public static string priceListPath; + + public void AutoOpen() + { + RegisterFunctions(); + GetRegistryKeys(); + } + + public void AutoClose() + { + + } + + void RegisterFunctions() + { + ExcelRegistration.GetExcelFunctions() + .ProcessAsyncRegistrations(nativeAsyncIfAvailable: false) + .RegisterFunctions(); + } + + void GetRegistryKeys() + { + RegistryKey addInKeys = Registry + .CurrentUser + .OpenSubKey("SOFTWARE") + .OpenSubKey("REHAU") + .OpenSubKey("SkuAssist"); + + responseOrder = (ResponseOrder)addInKeys.GetValue("ResponseOrder"); + priceListPath = (string)addInKeys.GetValue("PriceListPath"); + } + } +} -- cgit v1.2.3 From dc1fc8b221e9324fe0f82c4ea4a32d87d282bd25 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 8 Dec 2021 14:45:14 +0300 Subject: refactoring namespaces --- Source/AddIn/AddIn.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 3c82406..5255e2e 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -3,7 +3,7 @@ using ExcelDna.Registration; using Microsoft.Win32; using System.Net.Http; -namespace RehauSku.Assist +namespace RehauSku { public enum ResponseOrder { -- cgit v1.2.3 From b7c65d64e98092049fddc1b482bfc7aa97759d60 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 10 Dec 2021 13:56:28 +0300 Subject: Refactoring --- Source/AddIn/AddIn.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 5255e2e..e29c070 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -17,8 +17,8 @@ namespace RehauSku public class AddIn : IExcelAddIn { public static readonly HttpClient httpClient = new HttpClient(); - public static ResponseOrder responseOrder; - public static string priceListPath; + public static ResponseOrder StoreResponse { get; set; } + public static string PriceListPath { get; set; } public void AutoOpen() { @@ -46,8 +46,8 @@ namespace RehauSku .OpenSubKey("REHAU") .OpenSubKey("SkuAssist"); - responseOrder = (ResponseOrder)addInKeys.GetValue("ResponseOrder"); - priceListPath = (string)addInKeys.GetValue("PriceListPath"); + StoreResponse = (ResponseOrder)addInKeys.GetValue("ResponseOrder"); + PriceListPath = (string)addInKeys.GetValue("PriceListPath"); } } } -- cgit v1.2.3 From e175a634cefc6e8c0ecd49514a89b1d4f30ce33b Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Mon, 13 Dec 2021 20:39:41 +0300 Subject: Refactoring. ExcelDNA.IntelliSense library add. Add description to Excel functions. --- Source/AddIn/AddIn.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index e29c070..5cae777 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -1,4 +1,5 @@ using ExcelDna.Integration; +using ExcelDna.IntelliSense; using ExcelDna.Registration; using Microsoft.Win32; using System.Net.Http; @@ -24,11 +25,12 @@ namespace RehauSku { RegisterFunctions(); GetRegistryKeys(); + IntelliSenseServer.Install(); } public void AutoClose() { - + IntelliSenseServer.Uninstall(); } void RegisterFunctions() -- cgit v1.2.3 From 2511d1b4440d7c450eb50e1eafdc2ac11b42a5e0 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 17 Dec 2021 09:07:03 +0300 Subject: Add RegistryUtil --- Source/AddIn/AddIn.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 5cae777..7a2be5d 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -1,7 +1,6 @@ using ExcelDna.Integration; using ExcelDna.IntelliSense; using ExcelDna.Registration; -using Microsoft.Win32; using System.Net.Http; namespace RehauSku @@ -18,13 +17,12 @@ namespace RehauSku public class AddIn : IExcelAddIn { public static readonly HttpClient httpClient = new HttpClient(); - public static ResponseOrder StoreResponse { get; set; } - public static string PriceListPath { get; set; } + public static ResponseOrder StoreResponseOrder = RegistryUtil.StoreResponseOrder; + public static string PriceListPath = RegistryUtil.PriceListPath; public void AutoOpen() { RegisterFunctions(); - GetRegistryKeys(); IntelliSenseServer.Install(); } @@ -39,17 +37,5 @@ namespace RehauSku .ProcessAsyncRegistrations(nativeAsyncIfAvailable: false) .RegisterFunctions(); } - - void GetRegistryKeys() - { - RegistryKey addInKeys = Registry - .CurrentUser - .OpenSubKey("SOFTWARE") - .OpenSubKey("REHAU") - .OpenSubKey("SkuAssist"); - - StoreResponse = (ResponseOrder)addInKeys.GetValue("ResponseOrder"); - PriceListPath = (string)addInKeys.GetValue("PriceListPath"); - } } } -- cgit v1.2.3 From f97d344f39c46b5e2f883765e8859e78007a11b0 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 22 Dec 2021 08:26:54 +0300 Subject: Add Registry Util --- Source/AddIn/AddIn.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 7a2be5d..4a26f55 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -16,9 +16,7 @@ namespace RehauSku public class AddIn : IExcelAddIn { - public static readonly HttpClient httpClient = new HttpClient(); - public static ResponseOrder StoreResponseOrder = RegistryUtil.StoreResponseOrder; - public static string PriceListPath = RegistryUtil.PriceListPath; + public static HttpClient httpClient = new HttpClient(); public void AutoOpen() { -- cgit v1.2.3 From ce5597d042062c820288c63b4e571ee77ac23ab0 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Wed, 22 Dec 2021 17:07:37 +0300 Subject: RegistryUtil and some fixes --- Source/AddIn/AddIn.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 4a26f55..08b6dcf 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -22,6 +22,7 @@ namespace RehauSku { RegisterFunctions(); IntelliSenseServer.Install(); + RegistryUtil.Initialize(); } public void AutoClose() -- cgit v1.2.3 From 0513ac5ad7c7de498b794c27728c2c8ff306f941 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Thu, 23 Dec 2021 15:31:23 +0300 Subject: Rename to ExportTool --- Source/AddIn/AddIn.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 08b6dcf..014b607 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -28,6 +28,7 @@ namespace RehauSku public void AutoClose() { IntelliSenseServer.Uninstall(); + RegistryUtil.Uninitialize(); } void RegisterFunctions() -- cgit v1.2.3 From 24024b5729c1c44bb01cb29813868743d1753e31 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Fri, 24 Dec 2021 16:22:03 +0300 Subject: MergeTool, MemoryUtil anf stuff --- Source/AddIn/AddIn.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source/AddIn/AddIn.cs') diff --git a/Source/AddIn/AddIn.cs b/Source/AddIn/AddIn.cs index 014b607..67cdcc8 100644 --- a/Source/AddIn/AddIn.cs +++ b/Source/AddIn/AddIn.cs @@ -2,6 +2,8 @@ using ExcelDna.IntelliSense; using ExcelDna.Registration; using System.Net.Http; +using System.Runtime.Caching; + namespace RehauSku { @@ -16,10 +18,13 @@ namespace RehauSku public class AddIn : IExcelAddIn { - public static HttpClient httpClient = new HttpClient(); + public static HttpClient httpClient; + public static MemoryCache memoryCache; public void AutoOpen() { + httpClient = new HttpClient(); + memoryCache = new MemoryCache("RehauSku"); RegisterFunctions(); IntelliSenseServer.Install(); RegistryUtil.Initialize(); @@ -29,6 +34,7 @@ namespace RehauSku { IntelliSenseServer.Uninstall(); RegistryUtil.Uninitialize(); + memoryCache.Dispose(); } void RegisterFunctions() -- cgit v1.2.3