diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-06 17:44:33 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2021-12-06 17:44:33 +0300 |
commit | d47e5d5282e89d1fcc69bf3907aa459277fcc104 (patch) | |
tree | 5764a3e971df513c871a30f21ffc39cc3101bbdd /Source/ExcelDNA | |
parent | 8bc62a6f024ae2c7d346fe3570c9c0241a773ec5 (diff) |
Add settings registry keys
Diffstat (limited to 'Source/ExcelDNA')
-rw-r--r-- | Source/ExcelDNA/AddIn.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Source/ExcelDNA/AddIn.cs b/Source/ExcelDNA/AddIn.cs index 25e5bfd..8a25799 100644 --- a/Source/ExcelDNA/AddIn.cs +++ b/Source/ExcelDNA/AddIn.cs @@ -1,6 +1,8 @@ using ExcelDna.Integration; using ExcelDna.Registration; +using Microsoft.Win32; using System.Net.Http; +using System.IO; namespace Rehau.Sku.Assist { @@ -17,15 +19,17 @@ namespace Rehau.Sku.Assist { public static readonly HttpClient httpClient = new HttpClient(); public static ResponseOrder responseOrder; + public string priceListPath; public void AutoOpen() { RegisterFunctions(); - responseOrder = ResponseOrder.NoSettings; + GetRegistryKeys(); } public void AutoClose() { + } void RegisterFunctions() @@ -34,5 +38,18 @@ namespace Rehau.Sku.Assist .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"); + } + } } |