blob: b0fcc3b0c6d515896e8da2de7b17f6aab534abbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
using ExcelDna.Integration;
using ExcelDna.IntelliSense;
using ExcelDna.Registration;
using Microsoft.Office.Interop.Excel;
using System.Net.Http;
using System.Runtime.Caching;
namespace RehauSku
{
enum ResponseOrder
{
Default,
Relevance,
Name,
Price,
Series
}
class AddIn : IExcelAddIn
{
public static HttpClient httpClient;
public static MemoryCache memoryCache;
public static Application Excel;
public void AutoOpen()
{
httpClient = new HttpClient();
memoryCache = new MemoryCache("RehauSku");
RegisterFunctions();
IntelliSenseServer.Install();
RegistryUtil.Initialize();
Excel = (Application)ExcelDnaUtil.Application;
}
public void AutoClose()
{
IntelliSenseServer.Uninstall();
RegistryUtil.Uninitialize();
memoryCache.Dispose();
}
void RegisterFunctions()
{
ExcelRegistration.GetExcelFunctions()
.ProcessAsyncRegistrations(nativeAsyncIfAvailable: false)
.RegisterFunctions();
}
}
}
|