aboutsummaryrefslogtreecommitdiff
path: root/Source/ExcelDNA/AddIn.cs
blob: 25e5bfd2e68d54d3dd06326db0ccf7bc89a2773d (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
using ExcelDna.Integration;
using ExcelDna.Registration;
using System.Net.Http;

namespace Rehau.Sku.Assist
{
    public enum ResponseOrder
    {
        NoSettings,
        Relevance,
        Name,
        Price,
        Series
    }

    public class AddIn : IExcelAddIn
    {
        public static readonly HttpClient httpClient = new HttpClient();
        public static ResponseOrder responseOrder;

        public void AutoOpen()
        {
            RegisterFunctions();
            responseOrder = ResponseOrder.NoSettings;
        }

        public void AutoClose()
        {
        }

        void RegisterFunctions()
        {
            ExcelRegistration.GetExcelFunctions()
                             .ProcessAsyncRegistrations(nativeAsyncIfAvailable: false)
                             .RegisterFunctions();
        }
    }
}