RhSolutions-AddIn/Source/AddIn/AddIn.cs

42 lines
1010 B
C#
Raw Normal View History

2021-11-29 15:50:24 +03:00
using ExcelDna.Integration;
using ExcelDna.IntelliSense;
2021-11-29 15:50:24 +03:00
using ExcelDna.Registration;
using System.Net.Http;
2021-11-29 15:50:24 +03:00
2021-12-08 14:45:14 +03:00
namespace RehauSku
2021-11-29 15:50:24 +03:00
{
public enum ResponseOrder
{
Default,
Relevance,
Name,
Price,
Series
}
2021-11-29 15:50:24 +03:00
public class AddIn : IExcelAddIn
{
2021-12-05 21:14:33 +03:00
public static readonly HttpClient httpClient = new HttpClient();
2021-12-17 09:07:03 +03:00
public static ResponseOrder StoreResponseOrder = RegistryUtil.StoreResponseOrder;
public static string PriceListPath = RegistryUtil.PriceListPath;
2021-11-29 15:50:24 +03:00
public void AutoOpen()
{
RegisterFunctions();
IntelliSenseServer.Install();
2021-11-29 15:50:24 +03:00
}
public void AutoClose()
{
IntelliSenseServer.Uninstall();
2021-11-29 15:50:24 +03:00
}
void RegisterFunctions()
{
ExcelRegistration.GetExcelFunctions()
.ProcessAsyncRegistrations(nativeAsyncIfAvailable: false)
.RegisterFunctions();
}
}
}